0.0.2 • Published 6 years ago

buf-to-uint v0.0.2

Weekly downloads
6
License
SEE LICENSE IN LI...
Repository
github
Last release
6 years ago

buf-to-uint

Read an unsigned integer from a Buffer into a good ol' JavaScript Number. Uses bignum under-the-hood for bitwise operations. At this time only Big Endian support is provided.

example

var bufToUInt = require('buf-to-uint')

var buf = Buffer.from([0b01100000, 0b11001100])
var num1 = bufToUInt(buf, 1, 3)
var num2 = bufToUInt(buf, 12, 4)

console.log(num1, num2) // 6 12

license

License Zero Reciprocal Public License 2.0.1

0.0.2

6 years ago

0.0.1

6 years ago