Add support for generating other versions of UUIDs
jongpie opened this issue · 0 comments
jongpie commented
The current implementation of the code uses v4
of the UUID standard, which is still a very reliable manner of generating a randomized, unique ID. However, there are several newer versions of UUIDs, each with their own use cases. The specs for the newer versions aren't fully finalized, but seem to be I'd like to expand the current code to provide a way to specify which version of UUID is generated.
Some resources that discuss the differences & benefits of some of the new versions:
- https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html
- https://www.uuidtools.com/uuid-versions-explained
- https://blog.devgenius.io/analyzing-new-unique-identifier-formats-uuidv6-uuidv7-and-uuidv8-d6cc5cd7391a
At the moment, I'm considering these versions:
- Version 5 for consistently generated UUIDs: This version uses 2 inputs that will consistently produce the same
UUID
value when the same inputs are used - Version 7 for sortable UUIDs: This version uses an Epoch timestamp as part of the UUID generation, which results in the UUIDs being sortable based on when they were created
There are a few other official & unofficial versions, but these seem like the most useful ones to focus on.