diff options
Diffstat (limited to 'pgpwordlist/funcs.py')
-rw-r--r-- | pgpwordlist/funcs.py | 14 |
1 files changed, 7 insertions, 7 deletions
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) |