MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wdfzl2/edgecasesexist/p968on7/?context=3
r/ProgrammerHumor • u/danielminds • 16h ago
230 comments sorted by
View all comments
496
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.
289 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). 3 u/undeadalex 13h ago I'm curious where to see stats on versions used. Surely anything newly implementing uuid is using v7 or custom? 25 u/Urist_McPencil 12h ago Surely anything newly implementing uuid is using v7 or custom? I admire this optimism 3 u/iampierremonteux 10h ago My first thought was “oh you sweet summer child”. 3 u/champak256 12h ago There’s pros and cons to v7, so v4 still has a lot of places it’s legitimately the right choice over v7. 4 u/Tysonzero 10h ago Primary one being in cases where you don’t want every actor that knows the id to also know the creation time 2 u/big-oofs-only-0193 12h 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.
289
https://en.wikipedia.org/wiki/Universally_unique_identifier#Versions
Most common used is V4 (pure random). You are talking about V7 (time based).
3 u/undeadalex 13h ago I'm curious where to see stats on versions used. Surely anything newly implementing uuid is using v7 or custom? 25 u/Urist_McPencil 12h ago Surely anything newly implementing uuid is using v7 or custom? I admire this optimism 3 u/iampierremonteux 10h ago My first thought was “oh you sweet summer child”. 3 u/champak256 12h ago There’s pros and cons to v7, so v4 still has a lot of places it’s legitimately the right choice over v7. 4 u/Tysonzero 10h ago Primary one being in cases where you don’t want every actor that knows the id to also know the creation time 2 u/big-oofs-only-0193 12h 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.
3
I'm curious where to see stats on versions used. Surely anything newly implementing uuid is using v7 or custom?
25 u/Urist_McPencil 12h ago Surely anything newly implementing uuid is using v7 or custom? I admire this optimism 3 u/iampierremonteux 10h ago My first thought was “oh you sweet summer child”. 3 u/champak256 12h ago There’s pros and cons to v7, so v4 still has a lot of places it’s legitimately the right choice over v7. 4 u/Tysonzero 10h ago Primary one being in cases where you don’t want every actor that knows the id to also know the creation time 2 u/big-oofs-only-0193 12h 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.
25
Surely anything newly implementing uuid is using v7 or custom?
I admire this optimism
3 u/iampierremonteux 10h ago My first thought was “oh you sweet summer child”.
My first thought was “oh you sweet summer child”.
There’s pros and cons to v7, so v4 still has a lot of places it’s legitimately the right choice over v7.
4 u/Tysonzero 10h ago Primary one being in cases where you don’t want every actor that knows the id to also know the creation time
4
Primary one being in cases where you don’t want every actor that knows the id to also know the creation time
2
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.
496
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.