mirror of
https://github.com/wu736139669/Monkey-Test.git
synced 2026-08-06 06:14:53 +00:00
10 lines
205 B
JavaScript
10 lines
205 B
JavaScript
module.exports = xor;
|
|
function xor(a, b) {
|
|
var len = Math.min(a.length, b.length);
|
|
var out = new Buffer(len);
|
|
var i = -1;
|
|
while (++i < len) {
|
|
out.writeUInt8(a[i] ^ b[i], i);
|
|
}
|
|
return out;
|
|
} |