From d388791009194d570f1a3833728196326ba962b9 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Fri, 28 Jun 2024 15:00:43 -0400 Subject: [PATCH] A few more Python2 -> Python3 changes --- thesethreewords.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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