uint8ArrayToHex

Converts an array of bytes to a hexadecimal string.

Example

import { uint8arrayToHex } from "thirdweb/utils";
const hex = uint8arrayToHex(
new Uint8Array([
72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100,
]),
);
console.log(hex); // "0x48656c6c6f2c20776f726c64"
function uint8ArrayToHex(
value: Uint8Array<ArrayBufferLike>,
opts: Options,
): Hex;

Parameters

The array of bytes to convert.

Type

let value: Uint8Array<ArrayBufferLike>;

Optional parameters for the conversion.

Type

let opts: Options;

Returns

let returnType: ox__Hex.Hex;

The hexadecimal string representation of the bytes.