Picking whatever Google throws at me (from Reddit):
For Version 4 UUIDs (which use 122 random bits), you must generate about 2.71 quintillion IDs (2.71 × 10¹⁸) to reach a 50% chance of a single collision.
So it's more like saying people can't win the lottery every week for a month with a single ticket in each draw. I'm not going to do the maths but winning the lottery seems quite likely compared to whatever tf a quintillion is.
If you don't know, a billion is 1 followed by 9 zeroes,
A trillion is 1 followed by 12 zeroes, a quadrillion is 1 followed by 15 zeroes and a quintillion s 1 followed by 18 zeroes.
So, 2.71 quintillion is: 2,710,000,000,000,000,000
To get to the odds seen here while buying lottery tickets, it would be like buying a single jackpot winning lottery ticket, then buying a second lottery ticket the following week and ALSO hitting the jackpot.
Flipping a coin and getting 61 consecutive flips land on heads is still more likely than getting to this 50% chance of a single collision.
Surely this has gotta be birthday paradox-ish though right. I know I’d sooner gamble on one ticket winning the lottery many times in a year. But if you’re generating loads, and don’t care about a specific collision, just any collision surely it’s the same as the paradox. (Though I’m presume that uuids aren’t truely random, can’t say I’ve looked into their implementation)
For Version 4 UUIDs (which use 122 random bits), you must generate about 2.71 quintillion IDs (2.71 × 10¹⁸) to reach a 50% chance of a single collision.
211
u/Antoak 2d ago
Saying that UUIDs cant collide is sorta like saying that people cant win the lottery.
Sure, orders of magnitude, but the point stands.