aswi2020vldc-gitlab/templetes/node_modules/buffer-xor/index.js @ 0b434236
1 |
module.exports = function xor (a, b) { |
---|---|
2 |
var length = Math.min(a.length, b.length) |
3 |
var buffer = new Buffer(length) |
4 |
|
5 |
for (var i = 0; i < length; ++i) { |
6 |
buffer[i] = a[i] ^ b[i] |
7 |
}
|
8 |
|
9 |
return buffer |
10 |
}
|