Encode an unsigned integer as a little-endian byte sequence.
Used extensively in ESC/POS command construction wherever a multi-byte length or value field is required (e.g. GS ( k payload length). Equivalent to the python-escpos _int_low_high helper.
GS ( k
_int_low_high
Non-negative integer to encode.
Number of bytes to produce (1, 2, 3, or 4).
Little-endian Buffer of byteCount bytes.
byteCount
intLowHigh(512, 2); // => Buffer containing bytes [0x00, 0x02]intLowHigh(7, 2); // => Buffer containing bytes [0x07, 0x00] Copy
intLowHigh(512, 2); // => Buffer containing bytes [0x00, 0x02]intLowHigh(7, 2); // => Buffer containing bytes [0x07, 0x00]
1.0.0
Encode an unsigned integer as a little-endian byte sequence.
Used extensively in ESC/POS command construction wherever a multi-byte length or value field is required (e.g.
GS ( kpayload length). Equivalent to the python-escpos_int_low_highhelper.