Module

x/postgres/tests/test_deps.ts>hex

PostgreSQL driver for Deno
Extremely Popular
Go to Latest
namespace hex
import { hex } from "https://dotland.deno.dev/x/postgres@v0.19.0/tests/test_deps.ts";

Port of the Go encoding/hex library.

This module is browser compatible.

Examples

Example 1

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

const binary = new TextEncoder().encode("abc");
const encoded = encodeHex(binary);
console.log(encoded);
// => "616263"

console.log(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.