Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

std/encoding/hex.ts

The Deno Standard Library
Latest
import * as mod from "https://deno.land/std@0.224.0/encoding/hex.ts";

Port of the Go encoding/hex library.

This module is browser compatible.

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

const encoded = encodeHex("abc"); // "616263"

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

Functions

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

Converts data into a hex-encoded string.