diff --git a/thesethreewords.py b/thesethreewords.py index 4f68b26..e6bf164 100644 --- a/thesethreewords.py +++ b/thesethreewords.py @@ -150,7 +150,7 @@ class WordHasher(object): bytes = [integer & 0b11111111] for n in range(1,6): div = 2**(n*8) - bytes.append((integer/div) & 0b11111111) + bytes.append((integer//div) & 0b11111111) bytes.reverse() return bytes @@ -182,8 +182,8 @@ class WordHasher(object): A rugbit is like a byte but with 15bits instead of eight. """ fifteen_bits = 0b111111111111111 - rugbits = [(integer >> 30) & fifteen_bits, - (integer >> 15) & fifteen_bits, + rugbits = [(integer//(2**30)) & fifteen_bits, + (integer//(2**15)) & fifteen_bits, integer & fifteen_bits] return rugbits