convert 32 bit buffer (size 4 byte) to number (base 10).
Currently only support big endian.
Also checkout to-unsigned-int32
Install
npm i from-unsigned-int32
API
- Async API
var fromUInt32 = require('from-unsigned-int32')
fromUInt32(buffr , 4, function (err, res) {
console.log(res)
})
buffr
should be Buffer.
offset
this is optional parameter default is 0.
callback
get two arguments:
-
An error object.
-
number (base 10).
-
Sync API
var fromUInt32 = require('from-unsigned-int32')
console.log(fromUInt32.fromUInt32Sync(buffr ), 4)
buffr
should be Buffer.
offset
this is optional parameter default is 0.
returns integer
licence
MIT