xor_bytes

Function xor_bytes 

Source
pub fn xor_bytes(a: &[u8], b: &[u8]) -> Vec<u8> 
Expand description

XOR two byte slices of equal length.

§Panics

Panics if the slices have different lengths.

§Example

use quantacore::utils::xor_bytes;

let a = [0x00, 0xFF, 0x00, 0xFF];
let b = [0xFF, 0x00, 0xFF, 0x00];
let result = xor_bytes(&a, &b);
assert_eq!(result, vec![0xFF, 0xFF, 0xFF, 0xFF]);