From bdb0f645bc1bd040cf87be6247fb9f89e9b52f17 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 31 Dec 2016 22:59:17 +0200 Subject: Fix names to not override builtin hex --- pgpwordlist/funcs.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'pgpwordlist/funcs.py') diff --git a/pgpwordlist/funcs.py b/pgpwordlist/funcs.py index 84d3d0d..4e11b9f 100644 --- a/pgpwordlist/funcs.py +++ b/pgpwordlist/funcs.py @@ -21,22 +21,22 @@ import pgpwordlist _words = pgpwordlist.pgp_word_list -def get_word(hex, offset): - hex = hex.lower() - t = _words.get(hex) +def get_word(hexstr, offset): + hexstr = hexstr.lower() + t = _words.get(hexstr) if t is None: - raise KeyError(hex) + raise KeyError(hexstr) return t[offset % 2] def get_hex(word): - for hex, t in _words.items(): + for hexstr, t in _words.items(): if word.lower() in t: - return hex.lower() + return hexstr.lower() def hex_to_words(hexstr): - words = [get_word(hex, i) for i, hex in enumerate(_hex_bytes(hexstr))] + words = [get_word(h, i) for i, h in enumerate(_hex_bytes(hexstr))] return ' '.join(words) -- cgit v1.2.1