Decodes the given hex-encoded string. If the input is malformed, an error is thrown.
The hex-encoded string to decode.
The decoded data.
import { decodeHex } from "@std/encoding/hex";import { assertEquals } from "@std/assert";assertEquals( decodeHex("616263"), new TextEncoder().encode("abc"),); Copy
import { decodeHex } from "@std/encoding/hex";import { assertEquals } from "@std/assert";assertEquals( decodeHex("616263"), new TextEncoder().encode("abc"),);
Decodes the given hex-encoded string. If the input is malformed, an error is thrown.