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

Function writeBigU_Int64BE

lib/internal/buffer.js:610–630  ·  view source on GitHub ↗
(buf, value, offset, min, max)

Source from the content-addressed store, hash-verified

608}
609
610function writeBigU_Int64BE(buf, value, offset, min, max) {
611 checkInt(value, min, max, buf, offset, 7);
612
613 let lo = Number(value & 0xffffffffn);
614 buf[offset + 7] = lo;
615 lo = lo >> 8;
616 buf[offset + 6] = lo;
617 lo = lo >> 8;
618 buf[offset + 5] = lo;
619 lo = lo >> 8;
620 buf[offset + 4] = lo;
621 let hi = Number(value >> 32n & 0xffffffffn);
622 buf[offset + 3] = hi;
623 hi = hi >> 8;
624 buf[offset + 2] = hi;
625 hi = hi >> 8;
626 buf[offset + 1] = hi;
627 hi = hi >> 8;
628 buf[offset] = hi;
629 return offset + 8;
630}
631
632function writeBigUInt64BE(value, offset = 0) {
633 return writeBigU_Int64BE(this, value, offset, 0n, 0xffffffffffffffffn);

Callers 2

writeBigUInt64BEFunction · 0.85
writeBigInt64BEFunction · 0.85

Calls 1

checkIntFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…