Skip to main content

Function: toHex()

function toHex<T>(value): 0x${string}

Converts a string, number, bigint, boolean, or ByteArrayType to a hex string.

Type Parameters

Type Parameter

T extends | string | number | bigint | boolean | Uint8Array

Parameters

ParameterTypeDescription

value

T

The input to convert.

Returns

0x${string}

The hex string representation of the input.

Defined

@nilfoundation/niljs/src/encoding/toHex.ts:63