MCPcopy Index your code
hub / github.com/nodejs/node / readInt24BE

Function readInt24BE

lib/internal/buffer.js:496–505  ·  view source on GitHub ↗
(buf, offset = 0)

Source from the content-addressed store, hash-verified

494}
495
496function readInt24BE(buf, offset = 0) {
497 validateNumber(offset, 'offset');
498 const first = buf[offset];
499 const last = buf[offset + 2];
500 if (first === undefined || last === undefined)
501 boundsError(offset, buf.length - 3);
502
503 const val = first * 2 ** 16 + buf[++offset] * 2 ** 8 + last;
504 return val | (val & 2 ** 23) * 0x1fe;
505}
506
507function readInt16BE(buf, offset = 0) {
508 validateNumber(offset, 'offset');

Callers 1

readIntBEFunction · 0.85

Calls 1

boundsErrorFunction · 0.85

Tested by

no test coverage detected