pub fn decrypt_str(cipher: &[u8], password: &str) -> Result<String, std::str::Utf8Error> {
    let password_u8 = password.as_bytes();
    match std::str::from_utf8(&xor(&cipher, &password_u8)) {
        Ok(s) => return Ok(s.to_string()),
        Err(e) => return Err(e)
    };
}
/// Decrypt an array of bytes into a string
///
/// # Example
/// ```
/// use machiavelli::encode::{ encrypt_str, decrypt_str };
///
/// let message = "I am a string literal!";
/// let password = "passw0rd";
///
/// let cipher = encrypt_str(&message, &password);
/// let decrypted = decrypt_str(&cipher, &password).unwrap();
///
/// assert_eq!(message.to_string(), decrypted);
///
/// ```
Decrypt an array of bytes into a string
Decrypt an array of bytes into a string
pub fn decrypt_str(cipher: &[u8], password: &str) -> Result<String, std::str::Utf8Error> {
    let password_u8 = password.as_bytes();
    match std::str::from_utf8(&xor(&cipher, &password_u8)) {
        Ok(s) => return Ok(s.to_string()),
        Err(e) => return Err(e)
    };
}
pub fn decrypt_str ( cipher : & [ u8 ] , password : & str ) -> Result < String , std :: str :: Utf8Error > { let password_u8 = password . as_bytes ( ) ; match std :: str :: from_utf8 ( & xor ( & cipher , & password_u8 ) ) { Ok ( s ) => return Ok ( s . to_string ( ) ) , Err ( e ) => return Err ( e ) } ; }
Decrypt an array of bytes into a string
Decrypt an array of bytes into a string
cipher
&[u8]
password
&str
cipher
&[u8]
password
&str
example
```
use machiavelli::encode::{ encrypt_str, decrypt_str }.

let message = "I am a string literal!";
let password = "passw0rd".

let cipher = encrypt_str(&message, &password);
let decrypted = decrypt_str(&cipher, &password).unwrap().

assert_eq!(message.to_string(), decrypted).


` ` ` use machiavelli :: encode :: { encrypt_str decrypt_str } . let message = " I am a string literal! " ; let password = " passw0rd " . let cipher = encrypt_str ( &message &password ) ; let decrypted = decrypt_str ( &cipher &password ) . unwrap () . assert_eq! ( message . to_string () decrypted ) .