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

Add support for UUID version 7 #19

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Add support for UUID version 7 #19

merged 1 commit into from
Sep 19, 2023

Commits on Sep 18, 2023

  1. Add support for UUID version 7

    Although the specification for UUIDv7 is still in draft, the UUIDv7
    algorithm has been relatively stable as it progresses to completion.
    
    Version 7 UUIDs can be very useful, because they are lexographically
    sortable, which can improve e.g: database index locality.  See section
    6.10 of the draft specification for further explanation:
    
      https://datatracker.ietf.org/doc/draft-ietf-uuidrev-rfc4122bis/
    
    The specification allows up to 12 bits of extra timestamp precision, to
    make UUID generation closer to monotonically increasing.  This provides
    between 1ms and ~240ns of timestamp precision.  At the cost of some code
    complexity and a small performance penalty, a kwarg may specify any
    arbitrary precision between 0 and 12 extra bits.  Any stronger
    guarantees of monotonicity have considerably larger tradeoffs, so
    nothing more is implemented.  This limitation is documented.
    
    Ruby issue: https://bugs.ruby-lang.org/issues/19735
    nevans committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    34ed1a2 View commit details
    Browse the repository at this point in the history