wallet-core/node_modules/buffer-xor/index.js

11 lines
206 B
JavaScript
Raw Normal View History

2017-05-03 15:35:00 +02: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
}