Mathematically I suppose it's possible that even two random GUIDs generated using the built in method in the .NET framework are identical, but roughly how likely are they to clash if you generate hundreds or thousands?
If you generated one for every copy of Windows in the world, would they clash?
The reason I ask is because I have a program that creates a lot of objects, and destroys some too, and I am wondering about the likelihood of any of those objects (including the destroyed ones) having identical GUIDs.
There are ~3E38 possible GUID values. But the Birthday Paradox cuts the 50/50 odds to producing a duplicate GUID to ~1E19. While still an enormous number, comparing quite favorably to the odds that your machine will be destroyed by a meteor impact first, the system clock is used to ensure no duplicates can occur.
Many large and mission critical dbase apps use a GUID as the primary key in a table. Don't hesitate to follow their lead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With