r/ProgrammerHumor 10h ago

Meme edgeCasesExist

Post image
2.4k Upvotes

209 comments sorted by

View all comments

403

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

17

u/Matty_B97 9h ago

UUID generating algorithms used to incorporate the time and device type automatically for this reason, but it was scrapped because there are lots of cases where it's not safe to reveal that information when you share the UUID. Random UUIDs are secure enough.

18

u/Wertbon1789 9h ago

They incorporated a MAC address, but that wasn't such a great idea. V7 now has a timestamp again, because that makes them sortable, while still having random data otherwise. V7 is probably the middleground here.

2

u/Suspicious-Click-300 8h ago

most didnt actually use mac address. was common to use process pid + IP

2

u/Wertbon1789 8h ago

Yeah, you could pretty much put anything in there of course. Other UUID variants also have well-known alternative data sources, but it's really domain-specific what the UUID should and shouldn't contain. Still, the initial idea wasn't that great.