Skip to content

Commit

Permalink
add generate_key() compatibility with python2
Browse files Browse the repository at this point in the history
  • Loading branch information
jluismari committed Nov 23, 2016
1 parent 042f55b commit 5bc2783
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyrebase/pyrebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,11 @@ def generate_key(self):
time_stamp_chars = [0] * 8
for i in reversed(range(0, 8)):
time_stamp_chars[i] = push_chars[now % 64]
now = math.floor(now / 64)
now = int(math.floor(now / 64))
new_id = "".join(time_stamp_chars)
if not duplicate_time:
for i in range(0, 12):
self.last_rand_chars.append(math.floor(uniform(0, 1) * 64))
self.last_rand_chars.append(int(math.floor(uniform(0, 1) * 64)))
else:
for i in range(0, 11):
if self.last_rand_chars[i] == 63:
Expand Down

0 comments on commit 5bc2783

Please sign in to comment.