diff options
Diffstat (limited to 'hexnoise.py')
-rwxr-xr-x | hexnoise.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hexnoise.py b/hexnoise.py index d5bce09..6b0aad8 100755 --- a/hexnoise.py +++ b/hexnoise.py @@ -121,7 +121,9 @@ if __name__ == '__main__': from nouns import NOUNS from adjectives import ADJECTIVES def map_bytes_to_incantation(data): - return " ".join(f'{ADJECTIVES[a]:>16} {NOUNS[b]:<16}' for a, b in zip(data[0::2], data[1::2])) + elems = [ f'{ADJECTIVES[a]} {NOUNS[b]}' for a, b in zip(data[0::2], data[1::2]) ] + nfirst = ", ".join(elems[:-1]) + return f'{nfirst} and {elems[-1]}' print('Handshake channel binding incantation:') hhash = proto.get_handshake_hash() print(' ' + map_bytes_to_incantation(hhash[:8 ])) |