-
Notifications
You must be signed in to change notification settings - Fork 182
Open
Description
Suppose I generate a ULID, then convert it to a UUID.
Question
With which version of UUID is the result compatible?
Answer
Possibly none! Every UUID requires a variant and a version. This is also true of the original OSF DCE specification (page 586 gives the format, indicating version and variant).
A correctly-generated ULID will have random values in those fields. Thus, converting a ULID can result in a UUID that thinks its version number is anything from 0 to 15.
Why is this a problem?
I prefer to use ULID's internally, but to interact with other systems I need to generate UUID's that satisfies the requirements of a certain version. That means I'm basically out of luck, unless I want to bit-meddle. ...which I can do for the time being, but it seems like a suboptimal solution.
Proposals
- Add a caveat to the ULID spec that indicates this is a potential problem.
- Add a method that generates ULIDs compatible with a given UUID version. This probably shouldn't be allowed for UUIDs that have specific requirements.
christianhujer, theophanemayaud and FilipSolich
Metadata
Metadata
Assignees
Labels
No labels