fromHexfunctionfunction fromHex(text: string): Uint8Array<ArrayBufferLike> | undefinedHexadecimal text as bytes, or undefined where it is not an even number of hexadecimal digits.
Hexadecimal text: bytes as lower-case hexadecimal, two digits each, and hexadecimal text as bytes (commons 0001-crypto FR-001). Taken from sha256.ts, which every digest is written through, so that a format of bytes is in the library of formats and the digests depend on it.
import { fromHex, toHex } from "./hex.ts";
toHex(new Uint8Array([1, 255])); // "01ff"
fromHex("01ff"); // Uint8Array [1, 255]fromHexfunctionfunction fromHex(text: string): Uint8Array<ArrayBufferLike> | undefinedHexadecimal text as bytes, or undefined where it is not an even number of hexadecimal digits.
toHexfunctionfunction toHex(bytes: Uint8Array<ArrayBufferLike>): stringBytes as lower-case hexadecimal, two digits each.