]> git.aero2k.de Git - sirius.git/commitdiff
bytes don't encode as hex with Python 3, with just .hex() 'em
authorJoshua May <notjosh@gmail.com>
Sat, 14 Sep 2019 01:37:17 +0000 (18:37 -0700)
committerJoshua May <notjosh@gmail.com>
Sat, 14 Sep 2019 01:37:17 +0000 (18:37 -0700)
sirius/fake/commands.py

index 50749b25fab5e4b81c1208147d9d3a2b06c58f73..908b470ec0eed7704717702324330e32912a798d 100644 (file)
@@ -22,9 +22,9 @@ fake_manager = script.Manager(sub_opts, usage="Fake printer interactions.")
 
 @fake_manager.command
 def printer():
-    device_address = os.urandom(8).encode('hex')
+    device_address = os.urandom(8).hex()
     xor = bitshuffle.hardware_xor_from_device_address(device_address)
-    secret = os.urandom(5).encode('hex')
+    secret = os.urandom(5).hex()
 
     cc = claiming.encode(xor, int(secret, 16))
     printer = hardware.Printer(