Skip to content

Commit 5c87adf

Browse files
committed
Always use hashlib.md5 for consistency as per Petr's comment.
1 parent 1d4216a commit 5c87adf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/uuid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,8 @@ def uuid3(namespace, name):
723723
"""Generate a UUID from the MD5 hash of a namespace UUID and a name."""
724724
if isinstance(name, str):
725725
name = bytes(name, "utf-8")
726-
import _md5
727-
h = _md5.md5(namespace.bytes + name, usedforsecurity=False)
726+
import hashlib
727+
h = hashlib.md5(namespace.bytes + name, usedforsecurity=False)
728728
int_uuid_3 = int.from_bytes(h.digest())
729729
int_uuid_3 &= _RFC_4122_CLEARFLAGS_MASK
730730
int_uuid_3 |= _RFC_4122_VERSION_3_FLAGS

0 commit comments

Comments
 (0)