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

Function readUInt48BE

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

Source from the content-addressed store, hash-verified

280}
281
282function readUInt48BE(buf, offset = 0) {
283 validateNumber(offset, 'offset');
284 const first = buf[offset];
285 const last = buf[offset + 5];
286 if (first === undefined || last === undefined)
287 boundsError(offset, buf.length - 6);
288
289 return (first * 2 ** 8 + buf[++offset]) * 2 ** 32 +
290 buf[++offset] * 2 ** 24 +
291 buf[++offset] * 2 ** 16 +
292 buf[++offset] * 2 ** 8 +
293 last;
294}
295
296function readUInt40BE(buf, offset = 0) {
297 validateNumber(offset, 'offset');

Callers 1

readUIntBEFunction · 0.85

Calls 1

boundsErrorFunction · 0.85

Tested by

no test coverage detected