diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-12-31 23:44:46 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-12-31 23:44:46 +0200 |
commit | ef1d710c3691e6cc21a563dc7dc6d63fd0d8fa98 (patch) | |
tree | 9911b219e5a27963ed4bc1b7aabcb886259a170a | |
parent | f20dc3a6271f6b584d4fc6e16c30da4624cfb027 (diff) | |
download | py_pgpwordlist-ef1d710c3691e6cc21a563dc7dc6d63fd0d8fa98.tar.gz |
Simplify word to hext lookup
-rw-r--r-- | pgpwordlist/funcs.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pgpwordlist/funcs.py b/pgpwordlist/funcs.py index 37a17be..c3648be 100644 --- a/pgpwordlist/funcs.py +++ b/pgpwordlist/funcs.py @@ -33,10 +33,7 @@ _w2hex = _make_reverse_lookup(_words) def get_word(hexstr, offset): - hexstr = hexstr.lower() - t = _words.get(hexstr) - if t is None: - raise KeyError(hexstr) + t = _words[hexstr.lower()] return t[offset % 2] |