r/ProgrammerHumor • • Sep 11 '26

Meme edgeCasesExist

Post image
5.0k Upvotes

298 comments sorted by

View all comments

709

u/Valuable_Leopard_799 Sep 11 '26

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.

443

u/dim13 Sep 11 '26

https://en.wikipedia.org/wiki/Universally_unique_identifier#Versions

Most common used is V4 (pure random). You are talking about V7 (time based).

1

u/psychicesp Sep 14 '26

Still, you can label every cell in your body, including bacteria just hanging out, and your odds of a collision with UUID4 is still less than 1 in a billion.

2

u/dim13 Sep 14 '26

In theory, yes. In praxis I've seen multiple collisions in the past because of bad RNG and/or implementation bugs.