buffer-bitwise

A simple module for bitwise operations on buffers.
Install
npm i buffer-bitwise
Example
const bitwiseBuffer = require('bitwise-buffer')
const { xor, and, or, nor, not, leftShift, rightShift, lshift, rshift } = bitwiseBuffer
const a = Buffer.from('0f0f', 'hex')
const b = Buffer.from('ff00', 'hex')
xor(a, b).toString('hex')
or(a, b).toString('hex')
and(a, b).toString('hex')
nor(a, b).toString('hex')
not(a).toString('hex')
leftShift(a, 4).toString('hex')
rightShift(a, 4).toString('hex')
leftShift(a, 4, 1).toString('hex')
lshift === leftShift
rshift === rightShift
const c = Buffer.from('ff00fff0f', 'hex')
xor(a, c).toString('hex')
xor(c, a).toString('hex')
const d = not.mut(a)
a === d
a.toString('hex')
const e = Buffer.from('0ff0', 'hex')
const f = Buffer.from('f0f0ff0f00', 'hex')
const g = xor.mut(e, f)
g === e
e.toString('hex')
bitwiseBuffer.xor.mut === bitwiseBuffer.mut.xor
License
MIT