def do_random_mn(nbytes,wordlist): hexrand = ba.hexlify(get_random(nbytes)) Vmsg("Seed: %s" % hexrand) for wlname in (wordlists if wordlist == "all" else [wordlist]): if wordlist == "all": Msg("%s mnemonic:" % (wlname.capitalize())) mn = Mnemonic.hex2mn(hexrand,wordlist=wlname) Msg(" ".join(mn))
def mn_printlist(wordlist=dfl_wordlist): wl = Mnemonic.get_wordlist(wordlist) Msg("\n".join(wl))
def mn_stats(wordlist=dfl_wordlist): Mnemonic.check_wordlist(wordlist)
def hextob32(s): b32a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" Msg("".join(Mnemonic.hextobaseN(32,s,b32a)))
def b32tohex(s): b32a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" Msg(Mnemonic.baseNtohex(32,s,b32a))
def mn2hex(s,wordlist=dfl_wordlist): hexnum = Mnemonic.mn2hex(s.split(),wordlist) Msg(hexnum)
def hex2mn(s,wordlist=dfl_wordlist): mn = Mnemonic.hex2mn(s,wordlist) Msg(" ".join(mn))