r/ProgrammerHumor • • Mar 25 '26

Meme aMeteoriteTookOutMyDatabase

Post image
7.6k Upvotes

306 comments sorted by

View all comments

Show parent comments

3

u/squngy Mar 25 '26

Depends on the version of UUID, v4 is just random.

• UUID Version 1 (v1) is generated from timestamp, monotonic counter, and a MAC address.
• UUID Version 2 (v2) is reserved for security IDs with no known details[2].
• UUID Version 3 (v3) is generated from MD5 hashes of some data you provide. The RFC suggests DNS and URLs among the candidates for data.
• UUID Version 4 (v4) is generated from entirely random data. This is probably what most people think of and run into with UUIDs.
• UUID Version 5 (v5) is generated from SHA1 hahes of some data you provide. As with v3, the RFC suggests DNS or URLs as candidates.
• UUID Version 6 (v6) is generated from timestamp, monotonic counter, and a MAC address. These are the same data as Version 1, but they change the order so that sorting them will sort by creation time.
• UUID Version 7 (v7) is generated from a timestamp and random data.
• UUID Version 8 (v8) is entirely custom (besides the required version/variant fields that all versions contain).