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

Function readBigUInt64LE

lib/internal/buffer.js:98–116  ·  view source on GitHub ↗
(offset = 0)

Source from the content-addressed store, hash-verified

96
97// Read integers.
98function readBigUInt64LE(offset = 0) {
99 validateNumber(offset, 'offset');
100 const first = this[offset];
101 const last = this[offset + 7];
102 if (first === undefined || last === undefined)
103 boundsError(offset, this.length - 8);
104
105 const lo = first +
106 this[++offset] * 2 ** 8 +
107 this[++offset] * 2 ** 16 +
108 this[++offset] * 2 ** 24;
109
110 const hi = this[++offset] +
111 this[++offset] * 2 ** 8 +
112 this[++offset] * 2 ** 16 +
113 last * 2 ** 24;
114
115 return BigInt(lo) + (BigInt(hi) << 32n);
116}
117
118function readBigUInt64BE(offset = 0) {
119 validateNumber(offset, 'offset');

Callers

nothing calls this directly

Calls 1

boundsErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…