0.0.2 • Published 7 years ago
buf-to-uint v0.0.2
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