is it possible to have a duplicate uuid generated in vb.net?
-
is it possible to have a duplicate uuid generated in vb.net?
MsgBox(Guid.NewGuid().ToString)
What???
-
is it possible to have a duplicate uuid generated in vb.net?
MsgBox(Guid.NewGuid().ToString)
What???
-
is it possible to have a duplicate uuid generated in vb.net?
MsgBox(Guid.NewGuid().ToString)
What???
A Guid is 128 bit. Therefore you would have to generate 2^128 + 1 GUIDs to encounter a single GUID twice. A thread on StackOverflow.com[^] says that you would need about 10790283070806014188970 years to encounter a single GUID twice, assuming your program does nothing else than creating GUIDs and runs at a processor speed of 1 GhZ, without any interruption by CPU power eaten by other programs or the operating system itself. As you probably can think now, encountering the same GUID twice would be very bad luck and can safely considered as being unrealistic.
People becoming wiser in order to notice the stupid things they did back in the young days. This doesn't mean that they really stop doing those things. Wise people still do stupid things, only on purpose.
-
A Guid is 128 bit. Therefore you would have to generate 2^128 + 1 GUIDs to encounter a single GUID twice. A thread on StackOverflow.com[^] says that you would need about 10790283070806014188970 years to encounter a single GUID twice, assuming your program does nothing else than creating GUIDs and runs at a processor speed of 1 GhZ, without any interruption by CPU power eaten by other programs or the operating system itself. As you probably can think now, encountering the same GUID twice would be very bad luck and can safely considered as being unrealistic.
People becoming wiser in order to notice the stupid things they did back in the young days. This doesn't mean that they really stop doing those things. Wise people still do stupid things, only on purpose.
Marco Bertschi wrote:
Therefore you would have to generate 2^128 + 1 GUIDs to encounter a single GUID twice.
Not quite. GUIDs aren't entirely random, so you'd only need 2122 to get a collision with a specific GUID. To get a collision anywhere within the set of generated GUIDs, you'd only need to generate around 261 GUIDs. Eric Lippert goes into more detail in part 3 of his GUID guide series[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Marco Bertschi wrote:
Therefore you would have to generate 2^128 + 1 GUIDs to encounter a single GUID twice.
Not quite. GUIDs aren't entirely random, so you'd only need 2122 to get a collision with a specific GUID. To get a collision anywhere within the set of generated GUIDs, you'd only need to generate around 261 GUIDs. Eric Lippert goes into more detail in part 3 of his GUID guide series[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Richard Deeming wrote:
Not quite. GUIDs aren't entirely random, so you'd only need 2122 to get a collision with a specific GUID. To get a collision anywhere within the set of generated GUIDs, you'd only need to generate around 261 GUIDs.
Yep - Mark has posted about my brain glitch[^], too.
People becoming wiser in order to notice the stupid things they did back in the young days. This doesn't mean that they really stop doing those things. Wise people still do stupid things, only on purpose.