Inverse of fromText, modulo whitespace count.
toText (BSL.pack [104, 101, 108, 108, 111])"frighten glossary glucose handiwork gremlin"
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Modulepgp-wordlist-0.1.0.3Haskell2010
Core functionality for conversion between binary formats and PGP word lists.
Inverse of fromText, modulo whitespace count.
toText (BSL.pack [104, 101, 108, 108, 111])"frighten glossary glucose handiwork gremlin"
Convert a text of whitespace-separated words to their binary representation. The whitespace splitting behaviour is given by words.
fromText (T.pack "frighten glossary glucose handiwork gremlin")Right "hello"
Invalid words are recognized:
fromText (T.pack "frighten dragon glucose handiwork gremlin")Left (BadWord "dragon")
Typical mistakes include accidentally swapping numbers, which leads to a parity error:
fromText (T.pack "frighten glucose glossary handiwork gremlin")Left (BadParity "glucose" 108)
Look up the word corresponding to a byte.
Look up the word corresponding to a byte.
Simple conversion, taking into account invalid words.
Simple conversion, taking into account invalid words.
Look up a word in both databases.
Mapping from and to EvenWords
Mapping from and to OddWords