pub fn decode(text: &str) -> Result<Decoded, Bip39Error>Expand description
Read a phrase back into its entropy. Words are separated by whitespace.
use rite_model::bip39;
let phrase = bip39::encode(&[0x7F; 16]).unwrap();
assert_eq!(*bip39::decode(&phrase.to_uppercase()).unwrap().bytes, [0x7F; 16]);
// The first four letters of each word are enough.
let short: Vec<String> = phrase.split(' ').map(|w| w.chars().take(4).collect()).collect();
assert_eq!(*bip39::decode(&short.join(" ")).unwrap().bytes, [0x7F; 16]);ยงErrors
A word not in the list, a count that is not a phrase, or a checksum that does not match, each named by position.