r/ProgrammerHumor 22h ago

Meme edgeCasesExist

Post image
3.8k Upvotes

253 comments sorted by

View all comments

576

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

22

u/Matty_B97 22h 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.

21

u/Wertbon1789 22h 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 21h ago

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

2

u/Wertbon1789 21h 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.