/// Takes the key for the Simple Substitution cipher and returns a
/// corresponding Substitution struct.
///
/// # Panics
/// * If `key` is not 26 chars in length.
/// * If `key` is not alphabetic.
/// * If `key` contains repeated chars.
Takes the key for the Simple Substitution cipher and returns a
corresponding Substitution struct.
Takes the key for the Simple Substitution cipher and returns a corresponding Substitution struct .
pub fn new(key: &str) -> Self {
        assert_eq!(key.len(), 26, "`key` must be 26 chars in length");
        input::is_alpha(key).expect("`key` must be alphabetic");
        input::no_repeated_chars(key).expect("`key` cannot contain repeated chars");
        Self {
            key: key.to_ascii_uppercase(),
        }
    }
pub fn new ( key : & str ) -> Self { assert_eq ! ( key len ( ) 26 " " ) ; input :: is_alpha ( key ) . expect ( " " ) ; input :: no_repeated_chars ( key ) . expect ( " " ) ; Self { key : key . to_ascii_uppercase ( ) , } }
Takes the key for the Simple Substitution cipher and returns a
corresponding Substitution struct.
Takes the key for the Simple Substitution cipher and returns a corresponding Substitution struct .
key
&str
panics
If `key` is not 26 chars in length.
If `key` is not alphabetic.
If `key` contains repeated chars.
If ` key ` is not 26 chars in length . If ` key ` is not alphabetic . If ` key ` contains repeated chars .