escpos-ts API - v1.0.0
    Preparing search index...

    Function intLowHigh

    • 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.

      Parameters

      • value: number

        Non-negative integer to encode.

      • byteCount: 1 | 2 | 3 | 4

        Number of bytes to produce (1, 2, 3, or 4).

      Returns Buffer

      Little-endian Buffer of byteCount bytes.

      intLowHigh(512, 2); // => Buffer containing bytes [0x00, 0x02]
      intLowHigh(7, 2); // => Buffer containing bytes [0x07, 0x00]

      1.0.0