method Buffer.writeUIntBE
Jump to headingBuffer.writeUIntBE(value: number,offset: number,byteLength: number,): numberWrites byteLength bytes of value to buf at the specified offsetas big-endian. Supports up to 48 bits of accuracy. Behavior is undefined
when value is anything other than an unsigned integer.
This function is also available under the writeUintBE alias.
import { Buffer } from 'node:buffer';
const buf = Buffer.allocUnsafe(6);
buf.writeUIntBE(0x1234567890ab, 0, 6);
console.log(buf);
// Prints: <Buffer 12 34 56 78 90 ab>
Parameters Jump to heading
Jump to headingvalue: numberNumber to be written to buf.
Jump to headingoffset: numberNumber of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength.
Jump to headingbyteLength: numberNumber of bytes to write. Must satisfy 0 < byteLength <= 6.
Return Type Jump to heading
numberoffset plus the number of bytes written.