writeUIntLE
Writes byteLength
bytes of value
to buf
at the specified offset
as little-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 writeUintLE
alias.
import { Buffer } from 'node:buffer';
const buf = Buffer.allocUnsafe(6);
buf.writeUIntLE(0x1234567890ab, 0, 6);
console.log(buf);
// Prints: <Buffer ab 90 78 56 34 12>
Content copied to clipboard
Since
v0.5.5
Return
offset
plus the number of bytes written.
Parameters
value
Number to be written to buf
.
offset
Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength
.
byteLength
Number of bytes to write. Must satisfy 0 < byteLength <= 6
.