pub fn xor_buffers(l: &[u8], r: &[u8]) -> Result<Vec<u8>, hex::FromHexError> {
    assert_eq!(l.len(), r.len());

    let l = hex::decode(l)?;
    let r = hex::decode(r)?;
    let mut result = Vec::new();

    for i in 0..l.len() {
        result.push(l[i] ^ r[i]);
    }

    Ok(result)
}
/// Fixed XOR for two byte buffers
///
/// Solution to problem 2 from set 1: <https://cryptopals.com/sets/1/challenges/2>
Fixed XOR for two byte buffers
Solution to problem 2 from set 1.
Fixed XOR for two byte buffers Solution to problem 2 from set 1 .
pub fn xor_buffers(l: &[u8], r: &[u8]) -> Result<Vec<u8>, hex::FromHexError> {
    assert_eq!(l.len(), r.len());
    let l = hex::decode(l)?;
    let r = hex::decode(r)?;
    let mut result = Vec::new();
    for i in 0..l.len() {
        result.push(l[i] ^ r[i]);
    }
    Ok(result)
}
pub fn xor_buffers ( l : & [ u8 ] , r : & [ u8 ] ) -> Result < Vec < u8 > , hex :: FromHexError > { assert_eq ! ( l len ( ) r len ( ) ) ; let l = hex :: decode ( l ) ? ; let r = hex :: decode ( r ) ? ; let mut result = Vec :: new ( ) ; for i in 0 .. l . len ( ) { result . push ( l [ i ] ^ r [ i ] ) ; } Ok ( result ) }
Fixed XOR for two byte buffers
Solution to problem 2 from set 1: <https://cryptopals.com/sets/1/challenges/2>
Fixed XOR for two byte buffers Solution to problem 2 from set 1 : <https : // cryptopals . com / sets / 1 / challenges / 2 >
l
&[u8]
r
&[u8]