Skip to content

Commit d9aadff

Browse files
committed
Switch to UUID1
1 parent dc577b8 commit d9aadff

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

beaker/util.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Beaker utilities"""
2-
import hashlib
2+
import uuid
33
import socket
44

55
import binascii
@@ -435,12 +435,8 @@ def deserialize(data_string, method):
435435

436436

437437
def machine_identifier():
438-
machine_hash = hashlib.md5()
439-
if not PY2:
440-
machine_hash.update(socket.gethostname().encode())
441-
else:
442-
machine_hash.update(socket.gethostname())
443-
return binascii.hexlify(machine_hash.digest()[0:3]).decode('ascii')
438+
# UUID1 includes a unique machine identifier
439+
return uuid.uuid1()
444440

445441

446442
def safe_write (filepath, contents):

0 commit comments

Comments
 (0)