Finish challenge 25 and update License

This commit is contained in:
2022-08-14 12:01:51 -04:00
parent 5158c16d56
commit 1eb76f52b1
7 changed files with 75 additions and 33 deletions

View File

@@ -39,3 +39,9 @@ pub fn read_hex_lines(path: &str) -> Vec<Bytes> {
.map(|line| Bytes::from_hex(&line.unwrap()))
.collect()
}
pub fn xor(a: &[u8], b: &[u8]) -> Vec<u8> {
Iterator::zip(a.iter(), b.iter())
.map(|z| *(z.0) ^ *(z.1))
.collect()
}