]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-89083: add support for UUID version 7 (RFC 9562) (#121119)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Tue, 4 Mar 2025 09:47:19 +0000 (10:47 +0100)
committerGitHub <noreply@github.com>
Tue, 4 Mar 2025 09:47:19 +0000 (10:47 +0100)
commit3929af5e3a203291dc07b40c9c3515492e3ba7b4
treecdf12cf2586ebff3eecfe4e56359c1aae35ea8b5
parent0b6e98c8417316a1692bfb98eaea7c44194dcf8d
gh-89083: add support for UUID version 7 (RFC 9562) (#121119)

Add support for generating UUIDv7 objects according to RFC 9562, §5.7 [1].

The functionality is provided by the `uuid.uuid7()` function. The implementation
is based on a 42-bit counter as described by Method 1, §6.2 [2] and guarantees
monotonicity within the same millisecond.

[1]: https://www.rfc-editor.org/rfc/rfc9562.html#section-5.7
[2]: https://www.rfc-editor.org/rfc/rfc9562.html#section-6.2

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Éric <merwok@netwok.org>
Doc/library/uuid.rst
Doc/whatsnew/3.14.rst
Lib/test/test_uuid.py
Lib/uuid.py
Misc/NEWS.d/next/Library/2024-06-28-11-27-25.gh-issue-89083.DKL_Sk.rst [new file with mode: 0644]