pdf-lite - v1.0.1
    Preparing search index...

    Function padBytes

    • Pads a byte array to a specified length with trailing zeros.

      Parameters

      • bytes: ByteArray

        The byte array to pad.

      • length: number

        The target length for the padded array.

      Returns ByteArray

      A new byte array padded to the specified length.

      Error if the input array is already longer than the target length.

      padBytes(new Uint8Array([1, 2]), 4) // Returns Uint8Array([1, 2, 0, 0])