Skip to content

Commit

Permalink
Apply early-Python-2.7 fix to performance fix
Browse files Browse the repository at this point in the history
Refs #3
Refs #11
  • Loading branch information
akx committed Sep 22, 2021
1 parent 75e3d85 commit 034de90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ulid2.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def generate_binary_ulid(timestamp=None, monotonic=False):
timestamp = calendar.timegm(timestamp.utctimetuple())

ts = int(timestamp * 1000.0)
ts_bytes = struct.pack('!Q', ts)[2:]
ts_bytes = struct.pack(b'!Q', ts)[2:]
entropy = os.urandom(10)
if monotonic and _last_timestamp == ts and _last_entropy is not None:
while entropy < _last_entropy:
Expand Down

0 comments on commit 034de90

Please sign in to comment.