fn decrypt(key: &String, enc: &String) -> Vec<u8> {
    let decoded : Vec<u8> = base64::decode(enc).unwrap();
    let mut out_bytes : Vec<u8> = Vec::new();
    let key_bytes : Vec<u8> = key.as_bytes().to_vec();
    for i in 0..decoded.len() {
        out_bytes.push(decoded[i] ^ key_bytes[i % key_bytes.len()]);
    }
    out_bytes
}
// Helper function to decrypt data. Takes in a b64 string and returns a vec of bytes
Helper function to decrypt data. Takes in a b64 string and returns a vec of bytes
Helper function to decrypt data . Takes in a b64 string and returns a vec of bytes
fn decrypt(key: &String, enc: &String) -> Vec<u8> {
    let decoded : Vec<u8> = base64::decode(enc).unwrap();
    let mut out_bytes : Vec<u8> = Vec::new();
    let key_bytes : Vec<u8> = key.as_bytes().to_vec();
    for i in 0..decoded.len() {
        out_bytes.push(decoded[i] ^ key_bytes[i % key_bytes.len()]);
    }
    out_bytes
}
fn decrypt ( key : & String , enc : & String ) -> Vec < u8 > { let decoded : Vec < u8 > = base64 :: decode ( enc ) . unwrap ( ) ; let mut out_bytes : Vec < u8 > = Vec :: new ( ) ; let key_bytes : Vec < u8 > = key . as_bytes ( ) . to_vec ( ) ; for i in 0 .. decoded . len ( ) { out_bytes . push ( decoded [ i ] ^ key_bytes [ i % key_bytes . len ( ) ] ) ; } out_bytes }
Helper function to decrypt data.
Helper function to decrypt data .
key
&String
enc
&String
key
&String
enc
&String