Web3JS Online
Viem Online
Webhooks, Alerts, and a simple API.
The pad function pads a hex value or byte array with leading or trailing zeros up to a specified size. It takes a value and an optional options object as input, and returns a new hex value or byte array with the padded zeros.
The dir property of the options object specifies the direction in which to pad the zeros. It can be set to "left" to pad the zeros on the left side of the value, or "right" to pad the zeros on the right side of the value. The default value of dir is "left".
The size property of the options object specifies the size (in bytes) of the targeted value. The default value of size is 32 bytes (64 hex characters).
Here are some examples of how you can use the pad function: