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

std/encoding/hex.ts>decodeHex

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function decodeHex
import { decodeHex } from "https://deno.land/std@0.220.0/encoding/hex.ts";

Decodes the given hex-encoded string. If the input is malformed, an error is thrown.

Examples

Example 1

import { decodeHex } from "https://deno.land/std@0.220.0/encoding/hex.ts";

decodeHex("616263"); // Uint8Array(3) [ 97, 98, 99 ]

Parameters

src: string

Returns

Uint8Array