Encode a positive integer as a 2-byte Uint16LE Uint8Array, clamping the results – values exceeding 0xffff (65535) return the same result as 0xffff, negative values will return the same result as 0.
0xffff
65535
0
For an alternative overflow behavior, see numberToBinUint16LE.
For the reverse, see binToNumberUint16LE.
the number to encode
Generated using TypeDoc
Encode a positive integer as a 2-byte Uint16LE Uint8Array, clamping the results – values exceeding
0xffff
(65535
) return the same result as0xffff
, negative values will return the same result as0
.For an alternative overflow behavior, see numberToBinUint16LE.
For the reverse, see binToNumberUint16LE.