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

Function readInt24LE

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

Source from the content-addressed store, hash-verified

402}
403
404function readInt24LE(buf, offset = 0) {
405 validateNumber(offset, 'offset');
406 const first = buf[offset];
407 const last = buf[offset + 2];
408 if (first === undefined || last === undefined)
409 boundsError(offset, buf.length - 3);
410
411 const val = first + buf[++offset] * 2 ** 8 + last * 2 ** 16;
412 return val | (val & 2 ** 23) * 0x1fe;
413}
414
415function readInt16LE(buf, offset = 0) {
416 validateNumber(offset, 'offset');

Callers 1

readIntLEFunction · 0.85

Calls 1

boundsErrorFunction · 0.85

Tested by

no test coverage detected