diff options
author | Rob Austein <sra@hactrn.net> | 2020-05-26 15:18:19 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2020-05-26 15:18:19 -0400 |
commit | ed4c22473f5fb07006e773137ed047950e25a4d8 (patch) | |
tree | 26f7b93d5447b2e0cf5bd9c92dcda70161a46545 /tests/test-rsa.py | |
parent | 1cd42f6d3332e1edf78b06bd7dcf51f5a1a7bb23 (diff) |
Wow, python-version-independent hexadecimal is painful
Diffstat (limited to 'tests/test-rsa.py')
-rw-r--r-- | tests/test-rsa.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test-rsa.py b/tests/test-rsa.py index 57c554d..d0538ed 100644 --- a/tests/test-rsa.py +++ b/tests/test-rsa.py @@ -78,8 +78,9 @@ def trailing_comma(item, sequence): return "" if item == sequence[-1] else "," def print_hex(name, value, comment): + value = hexlify(value).decode("ascii") printlines("static const uint8_t {name}[] = {{ /* {comment}, {length:d} bytes */", - wrapper.fill(", ".join("0x" + hexlify(v) for v in value)), + wrapper.fill(", ".join("0x" + value[i : i + 2] for i in range(0, len(value), 2))) "}};", "", name = name, comment = comment, length = len(value)) |