readUInt.js 307 B

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