Closed dcousens closed 9 years ago
It is interesting, because in other languages with a less verbose syntax, it might just be as simple as:
D-lang
int[3] c = a[] ^ b[]
Or say in Python w/ numpy
:
c = numpy.bitwise_xor(a, b)
Or if there wasn't that overhead for functional idioms, and the lack of decent binary arrays in JS, using ES6:
c = a.map((x, i) => a[i] ^ b[i])
But, alas. We don't have these things, and this stuff can be finicky. So, what do?
It is 10 lines of code, that were previously untested in isolation, they are now tested and consistent.
@jprichardson thoughts?
Yeah, I'm fine with it.
I've written this function enough times :), why not? Eh @jprichardson haha
edit: Maybe wait out on https://github.com/crypto-browserify/buffer-xor/issues/1?