pub fn decode_bytes(encoded_words: &[&str]) -> Result<Vec<u8>, usize> {
    let mut result = Vec::new();
    let words = words();
    for (i, encoded) in encoded_words.iter().enumerate() {
        let ix = words
            .binary_search(&encoded.to_lowercase().as_str())
            .map_err(|_| i)?;
        result.push(ix as u8);
    }
    Ok(result)
}
/// 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 a vector of words (as produced by `encode_bytes`) back into the
vector of bytes that produced them. In case of error , 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 a vector of words ( as produced by ` encode_bytes ` ) back into the vector of bytes that produced them . In case of error 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 .
pub fn decode_bytes(encoded_words: &[&str]) -> Result<Vec<u8>, usize> {
    let mut result = Vec::new();
    let words = words();
    for (i, encoded) in encoded_words.iter().enumerate() {
        let ix = words
            .binary_search(&encoded.to_lowercase().as_str())
            .map_err(|_| i)?;
        result.push(ix as u8);
    }
    Ok(result)
}
pub fn decode_bytes ( encoded_words : & [ & str ] ) -> Result < Vec < u8 > , usize > { let mut result = Vec :: new ( ) ; let words = words ( ) ; for ( i , encoded ) in encoded_words . iter ( ) . enumerate ( ) { let ix = words . binary_search ( & encoded . to_lowercase ( ) . as_str ( ) ) . map_err ( | _ | i ) ? ; result . push ( ix as u8 ) ; } Ok ( result ) }
Decode a vector of words (as produced by `encode_bytes`) back into the
vector of bytes that produced them.
Decode a vector of words ( as produced by ` encode_bytes ` ) back into the vector of bytes that produced them .
encoded_words
&[&str]
encoded_words
&[&str]