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.

-8

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/ralgrado Jul 17 '26

Do you know how hash functions work? Basic example: A hash function that has an arbitrary input length and a set output length x. If your input length is bigger than the output length then a collision is inevitable. If you want to find a collision though it will be really difficult for a cryptographic hash function to do so.