Closed jgehrcke closed 4 months ago
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.
@terryjreedy I think so, and I'd love to! Maybe @orsenthil can also help me with that (hello :wave:).
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 |
For reference, see discussion at https://discuss.python.org/t/add-uuid7-in-uuid-module-in-standard-library/44390.
It has landed: https://www.rfc-editor.org/rfc/rfc9562
@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?
Let's close this as a duplicate of the older https://github.com/python/cpython/issues/89083, which also mentions UUIDv8.
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: https://github.com/uuid6/uuid6-ietf-draft/issues/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: