Niklas Niklas - 1 month ago 7
C# Question

What are the chances to get a Guid.NewGuid () duplicate?


Possible Duplicate:

Is a GUID unique 100% of the time?

Simple proof that GUID is not unique




In MSDN you can read:

The chance that the value of the new Guid will be all zeros or equal to any other Guid is very low.

Say that you have an method that will create a file every second, and you use the method
Guid.NewGuid()
for filename, is it possible to get the same Guid then? Or will the local computer keep track in some way? How low is the chance ?

Answer

You would never run out of guids. The likelihood of duplicating them is VERY low:

http://betterexplained.com/articles/the-quick-guide-to-guids/