Oslo

encodeHex()

Encodes data into lowercase hex based on RFC 4648 ยง8. Use decodeHex() to decode hex strings.

Definition

function encodeHex(data: ArrayBuffer | TypedArray): string;

Parameters

  • data

Example

import { encodeHex } from "oslo/encoding";

const data = new TextEncoder("hello, world");
const encoded = encodeHex(data);