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

Function readInt40LE

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

Source from the content-addressed store, hash-verified

375}
376
377function readInt40LE(buf, offset = 0) {
378 validateNumber(offset, 'offset');
379 const first = buf[offset];
380 const last = buf[offset + 4];
381 if (first === undefined || last === undefined)
382 boundsError(offset, buf.length - 5);
383
384 return (last | (last & 2 ** 7) * 0x1fffffe) * 2 ** 32 +
385 first +
386 buf[++offset] * 2 ** 8 +
387 buf[++offset] * 2 ** 16 +
388 buf[++offset] * 2 ** 24;
389}
390
391function readInt32LE(buf, offset = 0) {
392 validateNumber(offset, 'offset');

Callers 1

readIntLEFunction · 0.85

Calls 1

boundsErrorFunction · 0.85

Tested by

no test coverage detected