nybble

1.0.4 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i nybble

    Weekly Downloads

    1

    Version

    1.0.4

    License

    MIT

    Last publish

    Collaborators

    • piot