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

x/deno/std/encoding/hex.ts>decode

A modern runtime for JavaScript and TypeScript.
Go to Latest
function decode
import { decode } from "https://deno.land/x/deno@v0.22.0/std/encoding/hex.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]