ethereumjs-monorepo

@ethereumjs/util


@ethereumjs/util / setLengthRight

Function: setLengthRight()

setLengthRight(msg, length, opts?): Uint8Array

Defined in: packages/util/src/bytes.ts:171

Right-pad bytes with trailing zeros to the target length.

Parameters

msg

Uint8Array

length

number

opts?

SetLengthOpts = {}

Returns

Uint8Array

Throws

If the input exceeds the target length unless SetLengthOpts.allowTruncate is set