buf-to-uint

0.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i buf-to-uint

Weekly Downloads

1

Version

0.0.2

License

SEE LICENSE IN LICENSE

Unpacked Size

3.62 kB

Total Files

4

Last publish

Collaborators

  • rhodey