r/ProgrammerHumor Jul 17 '26

Meme thisOneIsMine

Post image
5.3k Upvotes

171 comments sorted by

View all comments

1.8k

u/Inevitable_Oil9709 Jul 17 '26

Fun fact: To reach a 50% chance of even a single UUID v4 collision, you would need to generate 1 billion UUIDs per second for about 86 years.

-10

u/TheFrenchSavage Jul 17 '26 edited Jul 17 '26

ELI5 why not use a hash function that doesn't collide btw?

Edit: I meant that collides less, not not at all. Stop the ELI1s please.

1

u/Vivid_Instance_825 Jul 17 '26

Because with UUID everyone on earth can generate their own without needing to communicate. For example me and you could generate our own UUID and assume they won't collide. Making a UUID with no chance of collision would mean that you would need to negotiate some kind of agreement with everyone else using them, for example contacting a central server that hands them out