Package Exports
- from-unsigned-int32
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (from-unsigned-int32) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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 /*<Buffer 00 20 00 00 00 00 00 0c>*/, 4, function (err, res) {
console.log(res) //12
})
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 /*<Buffer 00 20 00 00 00 00 00 0c>*/), 4) //12
buffr
should be Buffer.
offset
this is optional parameter default is 0.
returns integer
licence
MIT