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

Function readInt48BE

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

Source from the content-addressed store, hash-verified

452}
453
454function readInt48BE(buf, offset = 0) {
455 validateNumber(offset, 'offset');
456 const first = buf[offset];
457 const last = buf[offset + 5];
458 if (first === undefined || last === undefined)
459 boundsError(offset, buf.length - 6);
460
461 const val = buf[++offset] + first * 2 ** 8;
462 return (val | (val & 2 ** 15) * 0x1fffe) * 2 ** 32 +
463 buf[++offset] * 2 ** 24 +
464 buf[++offset] * 2 ** 16 +
465 buf[++offset] * 2 ** 8 +
466 last;
467}
468
469function readInt40BE(buf, offset = 0) {
470 validateNumber(offset, 'offset');

Callers 1

readIntBEFunction · 0.85

Calls 1

boundsErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…