katoikia-app/web-ui/web-react/node_modules/buffer-xor/index.js

11 lines
206 B
JavaScript
Raw Normal View History

2022-07-06 04:15:11 +00:00
module.exports = function xor (a, b) {
var length = Math.min(a.length, b.length)
var buffer = new Buffer(length)
for (var i = 0; i < length; ++i) {
buffer[i] = a[i] ^ b[i]
}
return buffer
}