Docs

padHex

Pads a hexadecimal string with zeros to a specified size.

Example

import { padHex } from "thirdweb/utils";
const paddedHex = padHex("0x1a4", { size: 32 });
console.log(paddedHex); // "0x000000000000000000000000000001a4"

Parameters

Returns

The padded hexadecimal string.