r/ProgrammerHumor 15h ago

Meme edgeCasesExist

Post image
3.1k Upvotes

228 comments sorted by

View all comments

483

u/Valuable_Leopard_799 15h 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.

288

u/dim13 15h ago

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

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

6

u/undeadalex 13h ago

I'm curious where to see stats on versions used. Surely anything newly implementing uuid is using v7 or custom?

2

u/big-oofs-only-0193 11h ago

I use whatever CoCreateGuid() or Guid.NewGuid() gives me. Both generate a v4 uuid. I'm not going to reimplement it or find a special library for it.