Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkutaj/c62ac68aa4fc8f4fca8db5471abc525a to your computer and use it in GitHub Desktop.
Save pkutaj/c62ac68aa4fc8f4fca8db5471abc525a to your computer and use it in GitHub Desktop.
Explaining Different Versions of UUIDs

https://medium.com/p/2e5e7276168e/edit

Version Description Syntax Example Use Case
1 Based on the current time and the MAC address for the computer or "node" generating the UUID 8-4-4-4-12 ba6eb330-4f7f-11eb-a2fb-67c34e9ac07c If you just need a unique ID
2 Called "DCE security" UUIDs in RFC 4122. Version-2 specifications are published by DCE 8-4-4-4-12
3 Generated based on a "namespace" and unique "name". Namespace and name are concatenated and hashed. Version-3 UUIDs are based on an MD5 hash of the name and namespace 8-4-4-4-12 If you need to generate reproducible UUIDs from given names
4 Generated using random or pseudo-random numbers 8-4-4-4-12 4f73c2dc-7a2c-4d1f-9b76-1298a82ce0ee If you just need a unique ID
5 Generated based on a "namespace" and unique "name". Namespace and name are concatenated and hashed. Version-5 UUIDs are based on a SHA-1 hash of the name and namespace 8-4-4-4-12 If you need to generate reproducible UUIDs from given names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment