[][src]Crate mnumonic

Functions

decode_bytes

Decode a vector of words (as produced by encode_bytes) back into the vector of bytes that produced them. In case of error (e.g. the provided vector has an invalid word), the index of the invalid entry is returned as an Err. Note that the words are lowercased per Unicode rules before decoding. This allows for scenarios where the human transcribing the words mixes up the case of the words, or some other system's autocorrect mutates the case.

decode_u32

Decode a vector of words (as produced by encode_u32) back into the u32 that produced them. If the provided word vector has more than 4 words, then an Err(4) is produced; if any the words are invalid, then an Err is produced with the index of the bad entry in the input vector.

decode_u32_joined

Decode a phrase (as produced by encode_u32_joined). Basically the same as decode_u32 except it splits the phrase on whitespace to generate the words to decode.

encode_bytes

Encode an array of bytes into a corresponding vector of human readable words. The output vector will be the same length as the input vector.

encode_u32

Encode a u32 into a vector of words. The output vector will have at least one entry, and no more than four entries; each entry is a single human-language word. Each byte of the u32 is converted to a word, with leading zero bytes dropped.

encode_u32_joined

Same as encode_u32, except this also joins the individual words into a phrase. The words are joined using an ascii space character as delimiter.