wordlists 0.2.0

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

cfg_if! {
    if #[cfg(feature = "diceware-eff-large")] {
        /// The raw list of words in the EFF Large Wordlist.
        pub const EFF_LARGE_WORDLIST: [(&'static str, &'static str); 7776] =
            include!("../../static/wordlists/diceware/converted/eff_large_wordlist.txt.json");

        lazy_static! {
            /// The EFF Large Diceware Wordlist.
            pub static ref EFF_LARGE: DicewareWordlist = {
                let boxed = Box::new(EFF_LARGE_WORDLIST);
                DicewareWordlist::new(
                    "EFF Large Diceware Wordlist".to_string(),
                    5, 6, boxed
                )
            };
        }
    }
}

cfg_if! {
    if #[cfg(feature = "diceware-eff-short-v1")] {
        /// The raw list of words in the EFF V1 Short Wordlist.
        pub const EFF_SHORT_V1_WORDLIST: [(&'static str, &'static str); 1296] =
            include!("../../static/wordlists/diceware/converted/eff_short_wordlist_1.txt.json");

        lazy_static! {
            /// The EFF Short V1 Diceware Wordlist.
            pub static ref EFF_SHORT_V1: DicewareWordlist = {
                let boxed = Box::new(EFF_SHORT_V1_WORDLIST);
                DicewareWordlist::new(
                    "EFF Short Diceware Wordlist V1".to_string(),
                    4, 6, boxed
                )
            };
        }
    }
}

cfg_if! {
    if #[cfg(feature = "diceware-eff-short-v2")] {
        /// The raw list of words in the EFF V2 Short Wordlist.
        pub const EFF_SHORT_V2_WORDLIST: [(&'static str, &'static str); 1296] =
            include!("../../static/wordlists/diceware/converted/eff_short_wordlist_2_0.txt.json");

        lazy_static! {
            /// The EFF Short V2 Diceware Wordlist.
            pub static ref EFF_SHORT_V2: DicewareWordlist = {
                let boxed = Box::new(EFF_SHORT_V2_WORDLIST);
                DicewareWordlist::new(
                    "EFF Short Diceware Wordlist V2".to_string(),
                    4, 6, boxed
                )
            };
        }
    }
}

cfg_if! {
    if #[cfg(feature = "diceware-reinhold")] {
        /// The raw list of words in the Reinhold Diceware Wordlist.
        pub const REINHOLD_WORDLIST: [(&'static str, &'static str); 7776] =
            include!("../../static/wordlists/diceware/converted/diceware.wordlist.asc.json");

        lazy_static! {
            /// The Reinhold diceware wordlist.
            pub static ref REINHOLD: DicewareWordlist = {
                let boxed = Box::new(REINHOLD_WORDLIST);
                DicewareWordlist::new(
                    "Reinhold Diceware Wordlist".to_string(),
                    5, 6, boxed
                )
            };
        }
    }
}

cfg_if! {
    if #[cfg(feature = "diceware-beale")] {
        /// The raw list of words in the Beale Diceware Wordlist.
        pub const BEALE_WORDLIST: [(&'static str, &'static str); 7776] =
            include!("../../static/wordlists/diceware/converted/beale.wordlist.asc.json");

        lazy_static! {
            /// The Beale Diceware Wordlist.
            pub static ref BEALE: DicewareWordlist = {
                let boxed = Box::new(BEALE_WORDLIST);
                DicewareWordlist::new(
                    "Beale Diceware Wordlist".to_string(),
                    5, 6, boxed
                )
            };
        }
    }
}