All pastes #941763 Raw Edit

hexwords

public python v1 · immutable
·published 2008-03-13 22:35 UTC
rendered paste body
from __future__ import with_statementimport stringdef trans(s):    replace_table = {        'o': '0',        'i': '1',        'z': '2',        's': '5',        't': '7',        'g': '6',    }    for key, value in replace_table.iteritems():        s = s.replace(key, value)    return swith open('/usr/share/dict/words') as f:    for word in f:        word = word.strip()        newword = trans(word.lower())        if all(c in string.hexdigits for c in newword):            print '%s: Ox%s' % (word, newword)