JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4294
  • Score
    100M100P100Q125547F
  • License MIT

Utilities for encoding and decoding common formats like hex, base64, and varint. Ported from Deno's @std/encoding.

Package Exports

  • byte-encodings
  • byte-encodings/ascii85
  • byte-encodings/base32
  • byte-encodings/base58
  • byte-encodings/base64
  • byte-encodings/base64url
  • byte-encodings/hex
  • byte-encodings/unstable-base32
  • byte-encodings/unstable-base32-stream
  • byte-encodings/unstable-base64
  • byte-encodings/unstable-base64-stream
  • byte-encodings/unstable-hex
  • byte-encodings/unstable-hex-stream
  • byte-encodings/varint

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (byte-encodings) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

byte-encodings

npm GitHub Actions

This package is a port of Deno's @std/encoding, which provides utilities for encoding and decoding common formats like:

  • ascii85 (Adobe, btoa, RFC 1924, Z85)
  • base32
  • base58
  • base64
  • base64url
  • hex
  • varint

Note that every encoder takes Uint8Array or ArrayBuffer, and every decoder returns Uint8Array.

Here's the overview of the APIs that this package offers:

import { encodeAscii85,    decodeAscii85   } from "byte-encodings/ascii85"
import { encodeBase32,     decodeBase32    } from "byte-encodings/base32"
import { encodeBase58,     decodeBase58    } from "byte-encodings/base58"
import { encodeBase64,     decodeBase64    } from "byte-encodings/base64"
import { encodeBase64Url,  decodeBase64Url } from "byte-encodings/base64url"
import { encodeHex,        decodeHex       } from "byte-encodings/hex"
import { encodeVarint, decodeVarint, decodeVarint32 } from "byte-encodings/varint"

For your information, this package offers these unstable modules too:

  • byte-encodings/unstable-base32
  • byte-encodings/unstable-base32-stream
  • byte-encodings/unstable-base64
  • byte-encodings/unstable-base64-stream
  • byte-encodings/unstable-hex
  • byte-encodings/unstable-hex-stream

Since the APIs are identical to @std/encoding, for the complete API references, see the docs on @std/encoding's JSR.