Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0d49ccb
improve performance of UUIDs creation
picnixz Dec 19, 2024
603335f
add What's New entry
picnixz Dec 19, 2024
154ff8b
blurb
picnixz Dec 21, 2024
b965887
fix issue number
picnixz Dec 21, 2024
a8a1894
fix typos
picnixz Dec 21, 2024
c8aa752
ensure 14-bit clock sequence
picnixz Dec 21, 2024
8c9d5cf
Merge branch 'main' into perf/uuid/init-128150
picnixz Dec 21, 2024
a2278b8
add dedicated private fast constructor
picnixz Dec 21, 2024
0710549
revert UUIDv1 construction
picnixz Dec 21, 2024
5b6922f
change eager check into an assertion check for internal constructor
picnixz Dec 22, 2024
e631593
update performance results
picnixz Dec 22, 2024
1c10901
describe constants
picnixz Dec 23, 2024
0bc7321
revert UUIDv1 optimizations to reduce the diff
picnixz Dec 23, 2024
26b1eb1
simplify `_from_int` private constructor as per Pieter's review
picnixz Dec 23, 2024
df50a7a
revert micro-optimization of `not a <= x <= b`
picnixz Dec 23, 2024
c1ffa7d
use built-in `int` when it is not shadowed
picnixz Dec 23, 2024
cff86e9
remove rationale comment for HACL* MD5
picnixz Dec 23, 2024
7095aa4
remove rationale comment for OpenSSL SHA-1
picnixz Dec 23, 2024
4af1535
clear variant and version bits using dedicated mask
picnixz Dec 23, 2024
0d4c008
fix typos
picnixz Dec 25, 2024
9854f69
update benchmarks
picnixz Dec 25, 2024
897902b
remove un-necessary assertions
picnixz Dec 26, 2024
a8a19e1
use `object.__new__` instead of `cls.__new__`
picnixz Dec 26, 2024
ccb972b
Merge branch 'main' into perf/uuid/init-128150
picnixz Dec 27, 2024
e2b8b08
remove dedicated constant folding
picnixz Dec 27, 2024
1d4216a
update benchmarks
picnixz Dec 27, 2024
5c87adf
Always use `hashlib.md5` for consistency as per Petr's comment.
picnixz Jan 12, 2025
ea23629
update benchmarks
picnixz Jan 12, 2025
6d89e9d
Merge branch 'main' into perf/uuid/init-128150
picnixz Jan 13, 2025
bdf7c6e
update NEWS
picnixz Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
describe constants
  • Loading branch information
picnixz committed Dec 23, 2024
commit 1c1090163b05b23d46260bc7fe8db00893a0aa16
7 changes: 7 additions & 0 deletions Lib/uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,14 @@ class SafeUUID:
unknown = None


_UINT_128_MAX = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff
# 128-bit mask to clear the variant and version bits of a UUID integral value
#
# This is equivalent to the 2-complement of '(0xc000 << 48) | (0xf000 << 64)'.
Comment thread
picnixz marked this conversation as resolved.
Outdated
_RFC_4122_CLEARFLAGS_MASK = 0xffff_ffff_ffff_0fff_3fff_ffff_ffff_ffff
# RFC 4122 variant bits and version bits to activate on a UUID integral value.
#
# The values are equivalent to '(version << 76) | (0x8000 << 48)'.
_RFC_4122_VERSION_1_FLAGS = 0x0000_0000_0000_1000_8000_0000_0000_0000
_RFC_4122_VERSION_3_FLAGS = 0x0000_0000_0000_3000_8000_0000_0000_0000
_RFC_4122_VERSION_4_FLAGS = 0x0000_0000_0000_4000_8000_0000_0000_0000
Expand Down