wordlists 0.2.0

Take bits, give words.
Documentation
use crate::SingleListIndexingWordlist;
use lazy_static::lazy_static;

/// The Raw list of words in the BIP-39 Wordlist.
pub const BIP39_WORDLIST: [&'static str; 2048] =
    include!("../../static/wordlists/bip39/converted/wordlist.json");

lazy_static! {
    /// This is the BIP39 Wordlist encoded as an Indexing wordlist.
    pub static ref BIP39: SingleListIndexingWordlist = {
        let boxed = Box::new(BIP39_WORDLIST);
        SingleListIndexingWordlist::new(
            "S/KEY OTP Wordlist".to_string(),
            boxed
        )
    };
}

#[cfg(test)]
mod test {
    use super::{BIP39, BIP39_WORDLIST};
    use crate::bits::pack_indexes;
    use crate::{Result, Wordlist, WordlistByteConverter};
    use bitvec::prelude::*;

    #[test]
    fn validate_list_complete() {
        assert_eq!(2048, BIP39_WORDLIST.len());
        BIP39_WORDLIST.iter().for_each(|v| assert!(!v.is_empty()));
    }

    #[test]
    fn validate_bit_width() {
        assert_eq!(11, BIP39.index_bit_width().unwrap());
    }

    //#[test]
    //fn validate_convert() -> Result<()> {
    // https://github.com/trezor/python-mnemonic/blob/master/vectors.json
    //}
}