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 UUID version 6 and 7 to stdlib (Lib/uuid.py) once RFC 4122 becomes updated #102461

Closed
jgehrcke opened this issue Mar 6, 2023 · 7 comments
Closed
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@jgehrcke
Copy link

jgehrcke commented Mar 6, 2023

An update to RFC 4122 is well underway: https://datatracker.ietf.org/doc/draft-ietf-uuidrev-rfc4122bis/
The last version (as of the time of writing this) is from 16 February 2023.

Editorial work seems to be happening here: https://github.com/ietf-wg-uuidrev/rfc4122bis
High-level updates are communicated here: uuid6/uuid6-ietf-draft#122

Among others, this updated standard introduces UUID versions 6 and 7. The Internet community seems to be excited about those. I trust that it's rather uncontroversial that at least those two should be added to Python's standard library once the standard is complete. But of course we should collect opinions about that idea here.

Prior art:

@jgehrcke jgehrcke added the type-feature A feature request or enhancement label Mar 6, 2023
@terryjreedy
Copy link
Member

uuid.py is actively maintained, but no one has claimed it at https://devguide.python.org/core-developers/experts/.

@jgehrcke Are you in a position to submit a PR at the appropriate time?

@tiran Does your security interest include this module? You patched it last July.

@jgehrcke
Copy link
Author

jgehrcke commented Mar 7, 2023

@terryjreedy I think so, and I'd love to! Maybe @orsenthil can also help me with that (hello 👋).

@iritkatriel iritkatriel added the extension-modules C modules in the Modules dir label Nov 29, 2023
@sergeyprokhorenko
Copy link

sergeyprokhorenko commented Jan 28, 2024

I recommend using the following implementations as a basis:
JavaScript
Rust
PostgreSQL
Go language
with openssl-rand or secrets.randbits (try the benchmark) for better performance.

Segment length, bits Field in RFC Segment content
48 unix_ts_ms Timestamp
4 ver Version
1 rand_a Counter segment initialized to zero
11 rand_a Counter segment initialized with a pseudorandom number
2 var Variant
30 rand_b Counter segment initialized with a pseudorandom number
32 rand_b UUIDv7 segment filled with a pseudorandom number

@hugovk
Copy link
Member

hugovk commented Jan 28, 2024

For reference, see discussion at https://discuss.python.org/t/add-uuid7-in-uuid-module-in-standard-library/44390.

@nineteendo
Copy link
Contributor

It has landed: https://www.rfc-editor.org/rfc/rfc9562

@hugovk
Copy link
Member

hugovk commented May 23, 2024

@terryjreedy I think so, and I'd love to! Maybe @orsenthil can also help me with that (hello 👋).

@jgehrcke Hi, it's been a while, would you like to work on this for 3.14?

@hugovk
Copy link
Member

hugovk commented Jun 17, 2024

Let's close this as a duplicate of the older #89083, which also mentions UUIDv8.

@hugovk hugovk closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

6 participants