Pads a byte array to a specified length with trailing zeros.
The byte array to pad.
The target length for the padded array.
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]) Copy
padBytes(new Uint8Array([1, 2]), 4) // Returns Uint8Array([1, 2, 0, 0])
Pads a byte array to a specified length with trailing zeros.