aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/buildcommands.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-08-22 11:08:51 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-08-22 11:08:51 -0400
commite59d87525600f9171dcf93dd767aac9fe33c6e54 (patch)
treedc6ba67ba27517715294d959309629926c6b450f /scripts/buildcommands.py
parent69fc1e63b4c240a2e8d36736b551140db8acc08b (diff)
downloadkutter-e59d87525600f9171dcf93dd767aac9fe33c6e54.tar.gz
kutter-e59d87525600f9171dcf93dd767aac9fe33c6e54.tar.xz
kutter-e59d87525600f9171dcf93dd767aac9fe33c6e54.zip
ctr: Encode integers in hex
Replace the custom encoding with a hex encoding. This makes it a little easier to inspect the CTR conversions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'scripts/buildcommands.py')
-rw-r--r--scripts/buildcommands.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/buildcommands.py b/scripts/buildcommands.py
index b74581de..87bc297d 100644
--- a/scripts/buildcommands.py
+++ b/scripts/buildcommands.py
@@ -125,9 +125,9 @@ Handlers.append(HandlerEnumerations)
def decode_integer(value):
value = value.strip()
- if len(value) != 7 or value[0] not in '-+':
+ if len(value) != 11 or value[0] not in '-+' or value[1:3] != '0x':
error("Invalid encoded integer '%s'" % (value,))
- out = sum([(ord(c) - 48) << (i*6) for i, c in enumerate(value[1:])])
+ out = int(value[1:], 0)
if value[0] == '-':
out -= 1<<32
return out