hexToString

Converts a hexadecimal string to a UTF-8 string.

Example

import { hexToString } from "thirdweb/utils";
const string = hexToString("0x48656c6c6f2c20776f726c6421");
console.log(string); // "Hello, world!"
function hexToString(
hex: `0x${string}`,
): string;

Parameters

The hexadecimal string to convert.

Type

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

The options for the conversion.

Type

let opts: { size?: number };

Returns

let returnType: string;

The UTF-8 string representation of the hexadecimal string.