🔢 Encodes bytes to a hexadecimal string.

Syntax

TypeScript
import { encodeHex, stringToBytes } from '@opentf/std';

encodeHex(bytes: Uint8Array | ArrayBuffer): string

Parameters

  • bytes: The bytes to encode.

Returns

The hexadecimal encoded string.

Examples

TypeScript
encodeHex(new Uint8Array([72, 101, 108, 108, 111])) //=> '48656c6c6f'
Last updated on
Edit this page