Skip to content

Commit

Permalink
COMPUTE-448 Fix nonce generation for python3 (#1414)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpjensen authored Nov 14, 2024
1 parent 3916ac8 commit a5fa0e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/python/dxpy/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@ class Nonce:
'''
def __init__(self):
try:
self.nonce = "%s%f" % (str(binascii.hexlify(os.urandom(32))), time.time())
self.nonce = "%s%f" % (binascii.hexlify(os.urandom(32)).decode('utf-8'), time.time())
except:
random.seed(time.time())
self.nonce = "%s%f" % (str(random.getrandbits(8*26)), time.time())
self.nonce = "%s%f" % (random.getrandbits(8*26), time.time())

def __str__(self):
return self.nonce
Expand Down

0 comments on commit a5fa0e5

Please sign in to comment.