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

feat: increase timestamp precision for v7 uuids #15

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

cmackenzie1
Copy link
Owner

@cmackenzie1 cmackenzie1 commented Jan 3, 2025

Inspired by https://brandur.org/fragments/uuid-v7-monotonicity and the
https://www.rfc-editor.org/rfc/rfc9562.html#monotonicity_counters

Use increased timestamp precision to replace the first 12 bits of rand_a field. This helps ensure monotonicity within the same millisecond.

Closes #14

Inspired by https://brandur.org/fragments/uuid-v7-monotonicity
and the
https://www.rfc-editor.org/rfc/rfc9562.html#monotonicity_counters,

Use increased timestamp precision to replace the first 12 bits of
`rand_a` field. This helps ensure monotonicity within the same
millisecond.
@cmackenzie1 cmackenzie1 merged commit 51a7fe7 into main Jan 3, 2025
1 check passed
@cmackenzie1 cmackenzie1 deleted the uuidv7-monoticity branch January 3, 2025 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase precision of timestamp for better monoticity
1 participant