pgp-wordlist-0.1.0.1: Translate between binary data and a human-readable collection of words.

Safe HaskellNone
LanguageHaskell2010

Data.Text.PgpWordlist.Internal.Convert

Description

Core functionality for conversion between binary formats and PGP word lists.

Synopsis

Documentation

toText :: ByteString -> Text Source

Inverse of fromText, modulo whitespace count.

fromText :: Text -> Either TranslationError ByteString Source

Convert a text of whitespace-separated words to their binary representation. The whitespace splitting behaviour is given by words.

toEvenWord :: Word8 -> EvenWord Source

Look up the word corresponding to a byte.

toOddWord :: Word8 -> OddWord Source

Look up the word corresponding to a byte.

fromEvenWord :: Text -> Either TranslationError Word8 Source

Simple conversion, taking into account invalid words.

fromOddWord :: Text -> Either TranslationError Word8 Source

Simple conversion, taking into account invalid words.

evenMap :: Word8Bimap EvenWord Source

Mapping from and to EvenWords

oddMap :: Word8Bimap OddWord Source

Mapping from and to OddWords