UNPKG

305 BJavaScriptView Raw
1'use strict';
2
3// Abstract reading multi-byte unsigned integers
4function readUInt (buffer, bits, offset, isBigEndian) {
5 offset = offset || 0;
6 var endian = isBigEndian ? 'BE' : 'LE';
7 var method = buffer['readUInt' + bits + endian];
8 return method.call(buffer, offset);
9}
10
11module.exports = readUInt;