-
-
Notifications
You must be signed in to change notification settings - Fork 746
Adds UUID v7 support #10848
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
Adds UUID v7 support #10848
Conversation
Thanks for your pull request, @burner! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#10848" |
related to #9881 (comment) |
nameBasedSHA1 = 5, | ||
///Version 7 (milliseconds since unix epoch + random) | ||
timestampRandom = 7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happened to version 6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, the documentation https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html#name-uuid-version-6 is here.
v7 is a big deal as it works very well with DB's and contains a reasonable timestamp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I note that link also mentions a v8
this.data[5] = cast(ubyte)(epoch & 0xFF); | ||
|
||
// version and variant | ||
this.data[6] = (this.data[6] & 0x0F) | 0x70; | ||
this.data[8] = (this.data[8] & 0x3F) | 0x80; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
silly question, what about this.data[7]
? is that a -
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data[7] is random data, the version [6] and variant [8] are not stored next to each other
https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7
uuid are strange data layout wise IMO
6ed5c63
to
0a12b23
Compare
@thewilsonator thank you |
|
@thewilsonator passed already, thank you |
No description provided.