nybble
v1.0.4
Published
Bitbuffer and bitstream parser
Downloads
21
Readme
Nybble
Read bits from a buffer or octet array.
Installation
npm install nybble
Usage
nybble = require 'nybble'
buffer = nybble.bitBuffer [0xca, 0xfe]
a = buffer.readUnsigned 0, 4
# a should be equal to 0xa
readUnsigned(bitOffset, bitLength)
Returns the unsigned integer value.
readSigned(bitOffset, bitLength)
Returns the signed integer value.
readFloat(bitOffset)
Returns the single precision IEEE 754 float.
readDouble(bitOffset)
Returns the double precision IEEE 754 float.