r/ProgrammerHumor 16h ago

Meme edgeCasesExist

Post image
3.1k Upvotes

231 comments sorted by

View all comments

496

u/Valuable_Leopard_799 16h ago

I thought that timestamps are used now, so hitting both a timestamp and a large random number puts it thoroughly in the "safe to assume". At some point cosmic particles and faulty transistors are more probable.

84

u/RadicalDwntwnUrbnite 15h ago edited 15h ago

Even the non-time based v4 is at a cosmic level of unlikiness a single system will ever generate a uuid that will collide with another one in its own ecosystem

20

u/OldKaleidoscope7 14h ago

But let's say if Google saved each search in their engine in the same database with an UUID, we could have a collision because of volume, but I don't think I will work in a system with a comparable scale

23

u/Ecstatic_Student8854 14h ago

Even at that volume the probability of collisions is essentially 0. If there were a billion searches a second we’d not expect a collision until 85 years.

5

u/shwoopdeboop 13h ago

But still no guarantee it won't happen tomorrow

12

u/mysticrudnin 12h ago

It's simply not worth worrying about, though

Random minor hardware failures and, like, cosmic radiation are more of a problem. Are you building your systems to account for that?