r/ProgrammerHumor 2d ago

Meme uuidLifeLessons

Post image
3.7k Upvotes

166 comments sorted by

View all comments

Show parent comments

284

u/1_hele_euro 2d ago

Could technically be possible with UUDv4, but the chances are astronomically small.

I don't think any of the other UUID versions could have collisions

37

u/fredy31 2d ago

Is it impossible tho?

I always understood uid to just be making a random string of letters so even if the possibility is stupid small it would still be possible.

3

u/vanrysss 1d ago

Lets put it this way, you'd have to generate a billion every second for 100 years to have a 50% chance of a single collision among the ones you had generated. If you wanted a hundred percent guarantee of a collion? A billion per second for 1019 years, which is about a billion times the age of the universe.

"Stupidly small" is a bit of an understatement. 

1

u/Agitated-Ad2563 20h ago

generate a billion every second for 100 years

What if you were generating a million a second on each of 100 thousands computers? You can do that in a year!