hexToBool

Converts a hexadecimal string to a boolean value.

Example

import { hexToBool } from "thirdweb/utils";
const bool = hexToBool("0x01");
console.log(bool); // true
function hexToBool(hex: `0x${string}`, opts: HexToBoolOpts): boolean;

Parameters

The hexadecimal string to convert.

Type

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

Optional options for the conversion.

Type

let opts: { size?: number };

Returns

let returnType: boolean;

The boolean value corresponding to the hexadecimal string.