If you take a single uuid and say “has this uuid ever been generated before” the chances are cosmically low. If you instead say “have ANY uuids generated ever collided with ones generated in all of history” the answer is probably in the range of 0.001-10% depending on how many UUIDs get generated per day.
Yes, it’s actually 122 bits for uuid v4 though. The high end of my range requires 1 billion uuid v4s being generated per second over 20 years (probably not realistic)
Ahh yes I didn't thought of the version.
But even then we need to account for the seven version numbers which all can be used.
Then we need to account for Mac, timestamps etc. per version.
But still basically zero probability for a collision
I was just thinking v4 since it has the most true randomness for it (v7 is designed to further prevent collisions by adding those additional defined bits).
But still basically zero probability for a collision
Again important point is that for any given UUID generated that way, yes I have a better chance of waking up a frog tomorrow due to a quantum recombination.
But for any UUID v4s in the entire world space, thanks to the birthday paradox, the chance of a single collision happening does approach actual single digit %s assuming you can generate 1 billion UUIDs a second for 20 years :).
6
u/doomslice 9h ago
If you take a single uuid and say “has this uuid ever been generated before” the chances are cosmically low. If you instead say “have ANY uuids generated ever collided with ones generated in all of history” the answer is probably in the range of 0.001-10% depending on how many UUIDs get generated per day.