fn decipher(&self, ctext: &str) -> CipherResult {
        input::is_alpha(ctext)?;

        let ctext = ctext.to_ascii_uppercase();
        let a_inv = invmod(self.a, 26).unwrap();

        let ptext = ctext
            .bytes()
            .map(move |c| (((a_inv * (c as i32 - 65 - self.b)) % 26 + 26) % 26) as u8 + 65)
            .collect();

        Ok(String::from_utf8(ptext).unwrap())
    }
/// Deciphers the given ciphertext (a str reference) using the Affine cipher
/// and returns the plaintext as a `CipherResult`.
///
/// # Example
/// ```
/// use ciphers::{Cipher, Affine};
///
/// let affine = Affine::new(7, 11);
///
/// let ptext = affine.decipher("GNUNYGOINNLHOJLKKFUOINZLHOKN");
/// assert_eq!(ptext.unwrap(), "DEFENDTHEEASTWALLOFTHECASTLE");
/// ```
Deciphers the given ciphertext (a str reference) using the Affine cipher
and returns the plaintext as a `CipherResult`.
Deciphers the given ciphertext ( a str reference ) using the Affine cipher and returns the plaintext as a ` CipherResult ` .
fn decipher(&self, ctext: &str) -> CipherResult {
        input::is_alpha(ctext)?;
        let ctext = ctext.to_ascii_uppercase();
        let a_inv = invmod(self.a, 26).unwrap();
        let ptext = ctext
            .bytes()
            .map(move |c| (((a_inv * (c as i32 - 65 - self.b)) % 26 + 26) % 26) as u8 + 65)
            .collect();
        Ok(String::from_utf8(ptext).unwrap())
    }
fn decipher ( & self , ctext : & str ) -> CipherResult { input :: is_alpha ( ctext ) ? ; let ctext = ctext . to_ascii_uppercase ( ) ; let a_inv = invmod ( self . a , 26 ) . unwrap ( ) ; let ptext = ctext . bytes ( ) . map ( move | c | ( ( ( a_inv * ( c as i32 - 65 - self . b ) ) % 26 + 26 ) % 26 ) as u8 + 65 ) . collect ( ) ; Ok ( String :: from_utf8 ( ptext ) . unwrap ( ) ) }
Deciphers the given ciphertext (a str reference) using the Affine cipher
and returns the plaintext as a `CipherResult`.
Deciphers the given ciphertext ( a str reference ) using the Affine cipher and returns the plaintext as a ` CipherResult ` .
&self
ctext
&str
&self
ctext
&str
example
```
use ciphers::{Cipher, Affine}.



let ptext = affine.decipher("GNUNYGOINNLHOJLKKFUOINZLHOKN");
assert_eq!(ptext.unwrap(), "DEFENDTHEEASTWALLOFTHECASTLE");
```
` ` ` use ciphers :: { Cipher Affine } . let ptext = affine . decipher ( " GNUNYGOINNLHOJLKKFUOINZLHOKN " ) ; assert_eq! ( ptext . unwrap () " DEFENDTHEEASTWALLOFTHECASTLE " ) ; ` ` `