Port of the Go encoding/hex library.
import { decodeHex, encodeHex, } from "@std/encoding/hex"; import { assertEquals } from "@std/assert"; assertEquals(encodeHex("abc"), "616263"); assertEquals( decodeHex("616263"), new TextEncoder().encode("abc"), );
Add Package
deno add jsr:@std/encoding
Import symbol
import * as mod from "@std/encoding/hex";
---- OR ----
Import directly with a jsr specifier
import * as mod from "jsr:@std/encoding/hex";
Add Package
npx jsr add @std/encoding
Import symbol
import * as mod from "@std/encoding/hex";
Add Package
yarn dlx jsr add @std/encoding
Import symbol
import * as mod from "@std/encoding/hex";
Add Package
pnpm dlx jsr add @std/encoding
Import symbol
import * as mod from "@std/encoding/hex";
Add Package
bunx jsr add @std/encoding
Import symbol
import * as mod from "@std/encoding/hex";