buffer-bitwise
A simple module for bitwise operations on buffers.
Install
npm i buffer-bitwise
Example
const bitwiseBuffer = const xor and or nor not leftShift rightShift lshift rshift = bitwiseBuffer const a = Bufferconst b = Buffer // 'f00f' // 'ff0f' // '0f00' // '00f0' // 'f0f0' // 'f0f0' // '00f0' // for shift operator you can chose to fill with 1 // 'f0ff' // lshift is an alias of leftShiftlshift === leftShift // true // rshift is an alias of rightShiftrshift === rightShift // true // for binary operator when operand length are differentsconst c = Buffer // 'f00ffff0f' // 'f00ffff0f' // all operator allocate new buffer// for mutable operator use operator.mutconst d = nota === d // truea // 'f0f0' // for binary operatorconst e = Bufferconst f = Buffer const g = xorg === e // truee // 'ff00' // #method.mut is an alias of #mut.method bitwiseBufferxormut === bitwiseBuffermutxor // true