boolToHex

Converts a boolean value to a hexadecimal string representation.

Example

import { boolToHex } from "thirdweb/utils";
const hex = boolToHex(true);
console.log(hex); // "0x01"
function boolToHex(value: boolean, opts: BoolToHexOpts): Hex;

Parameters

The boolean value to convert.

Type

let value: boolean;

Optional options for the conversion.

Type

let opts: { size?: number };

Returns

let returnType: `0x${string}`;

The hexadecimal string representation of the boolean value.