Codebase list node-buffer-xor / 07be4058-e8a6-4166-82bb-a252d6cccdf8/upstream inplace.js
07be4058-e8a6-4166-82bb-a252d6cccdf8/upstream

Tree @07be4058-e8a6-4166-82bb-a252d6cccdf8/upstream (Download .tar.gz)

inplace.js @07be4058-e8a6-4166-82bb-a252d6cccdf8/upstreamraw · history · blame

1
2
3
4
5
6
7
8
9
module.exports = function xorInplace (a, b) {
  var length = Math.min(a.length, b.length)

  for (var i = 0; i < length; ++i) {
    a[i] = a[i] ^ b[i]
  }

  return a
}