Skip to main content
Module

std/encoding/mod.ts>decodeHex

Deno standard library
Go to Latest
function decodeHex
import { decodeHex } from "https://deno.land/std@0.34.0/encoding/mod.ts";

Decode decodes src into decodedLen(src.length) bytes returning the actual number of bytes written to dst. Decode expects that src contains only hexadecimal characters and that src has even length. If the input is malformed, Decode returns the number of bytes decoded before the error.

Parameters

dst: Uint8Array
src: Uint8Array

Returns

[number, Error | void]