16
What is the probability of generating a Repeated Guid with Guid.NewGuid()
?
I am uploading numerous images from my system.
The same will be a Multitenancy, and will share the same Deploy, from the same folders.
I assign the name of the pictures with a Guid
+ extension(jpg, png or gif)
Is there any chance of generating a Guid
existing?
rod, isn’t it better to do sequential? or use seconds?
– Joannis
@Joannis if the name is formed by the seconds the chance of collision is real. Two images created in the same second can collide the name.
– Oralista de Sistemas
When I do this type of Upload, I use Datetime, or it is passed 1 thousandth would be impossible an equal number. Example 14/11/2014 16:28:31, leaving only numbers, 14112014162831, as I said, impossible to repeat this number.
– Diego Zanardo
@Diegozanardo In 1 thousandth of a second a 2 Ghz computer makes 2 Ghz / 1000 = 2 million clock cycles. There is too much cycle there to be no risk, I do not know the exact calculations, and I/O involved, besides the eventual occupation of this time by other processes of the operating system, but I would not be so categorical in saying that there is no risk of repetition.
– Piovezan