index.js 206 B

12345678910
  1. module.exports = function xor (a, b) {
  2. var length = Math.min(a.length, b.length)
  3. var buffer = new Buffer(length)
  4. for (var i = 0; i < length; ++i) {
  5. buffer[i] = a[i] ^ b[i]
  6. }
  7. return buffer
  8. }