Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/encoding.ts>decodeHex

A JavaScript extension package for building strong and modern applications.
Latest
function decodeHex
import { decodeHex } from "https://deno.land/x/ayonli_jsext@v0.9.72/encoding.ts";

Decodes the given hex string to a byte array.

Examples

Example 1

import { decodeHex } from "@ayonli/jsext/encoding";

const data = decodeHex("48656c6c6f2c20576f726c6421");
console.log(data); // Uint8Array(13) [ 72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33 ]

Parameters

hex: string

Returns

Uint8Array