pub fn xor(plaintext: &[u8], password: &[u8]) -> Vec<u8> {
    let mut cipher = Vec::<u8>::new();
    let n = password.len();
    for i in 0..plaintext.len() {
        cipher.push(plaintext[i] ^ password[i%n])
    }
    cipher
}
/// Encrypt a plaintext by xoring it with a password
///
/// # Example
/// ```
/// use machiavelli::encode::xor;
///
/// let plaintext: Vec<u8> = vec![1,2,3,4,5];
/// let password: Vec<u8> = vec![0,1];
///
/// let cipher = xor(&plaintext, &password);
///
/// assert_eq!(vec![1,3,3,5,5], cipher);
///
/// ```
Encrypt a plaintext by xoring it with a password
Encrypt a plaintext by xoring it with a password
pub fn xor(plaintext: &[u8], password: &[u8]) -> Vec<u8> {
    let mut cipher = Vec::<u8>::new();
    let n = password.len();
    for i in 0..plaintext.len() {
        cipher.push(plaintext[i] ^ password[i%n])
    }
    cipher
}
pub fn xor ( plaintext : & [ u8 ] , password : & [ u8 ] ) -> Vec < u8 > { let mut cipher = Vec :: < u8 > :: new ( ) ; let n = password . len ( ) ; for i in 0 .. plaintext . len ( ) { cipher . push ( plaintext [ i ] ^ password [ i % n ] ) } cipher }
Encrypt a plaintext by xoring it with a password
Encrypt a plaintext by xoring it with a password
plaintext
&[u8]
password
&[u8]
plaintext
&[u8]
password
&[u8]
example
```
use machiavelli::encode::xor.



let cipher = xor(&plaintext, &password).




` ` ` use machiavelli :: encode :: xor . let cipher = xor ( &plaintext &password ) .