summaryrefslogtreecommitdiffstats
path: root/Lib/uuid.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/uuid.py')
-rw-r--r--Lib/uuid.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/uuid.py b/Lib/uuid.py
index 029df51..89fc83c 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -535,8 +535,8 @@ def uuid1(node=None, clock_seq=None):
def uuid3(namespace, name):
"""Generate a UUID from the MD5 hash of a namespace UUID and a name."""
- import hashlib
- hash = hashlib.md5(namespace.bytes + name).digest()
+ from hashlib import md5
+ hash = md5(namespace.bytes + name).digest()
return UUID(bytes=hash[:16], version=3)
def uuid4():
@@ -558,8 +558,8 @@ def uuid4():
def uuid5(namespace, name):
"""Generate a UUID from the SHA-1 hash of a namespace UUID and a name."""
- import sha
- hash = sha.sha(namespace.bytes + name).digest()
+ from hashlib import sha1
+ hash = sha1(namespace.bytes + name).digest()
return UUID(bytes=hash[:16], version=5)
# The following standard UUIDs are for use with uuid3() or uuid5().