ethereumjs-monorepo

@ethereumjs/util


@ethereumjs/util / setLengthLeft

Function: setLengthLeft()

setLengthLeft(msg, length, opts?): Uint8Array

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

Left-pad bytes with leading 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