mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-01-19 23:26:32 +00:00
10 lines
187 B
Rust
10 lines
187 B
Rust
// XOR(x, y)
|
|
// If len(y) < len(x), wrap around inside y
|
|
pub fn xor_eq(x: &mut [u8], y: &[u8]) {
|
|
let y_len = y.len();
|
|
|
|
for i in 0..x.len() {
|
|
x[i] ^= y[i % y_len];
|
|
}
|
|
}
|