Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ULID generation #2

Open
bgrainger opened this issue Jul 4, 2023 · 0 comments · May be fixed by #3
Open

Support ULID generation #2

bgrainger opened this issue Jul 4, 2023 · 0 comments · May be fixed by #3
Labels
enhancement New feature or request

Comments

@bgrainger
Copy link
Owner

The ULID spec says:

  • 128-bit compatibility with UUID
  • 48 bit integer
  • 80 bits randomness

While an arbitrary 128-bit ULID is not strictly compatible with UUID (because it doesn't set the version and variant bits correctly), it is the case that every UUIDv7 is a valid ULID (because they both use the same 48-bit Unix timestamp and we can ignore the six bits of "randomness" that aren't actually set randomly).

NGuid could provide a method to format a UUIDv7 as a ULID string for interoperability between the two systems.

bgrainger added a commit that referenced this issue Jul 4, 2023
Signed-off-by: Bradley Grainger <[email protected]>
This was referenced Jul 4, 2023
@bgrainger bgrainger added the enhancement New feature or request label Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant