Skip to main content

@std/encoding@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score64%
Published2 years ago (0.215.0)

Utilities for working with ascii85 encoding.

This module is browser compatible.

Specifying a standard and delimiter

By default, all functions are using the most popular Adobe version of ascii85 and not adding any delimiter. However, there are three more standards supported - btoa (different delimiter and additional compression of 4 bytes equal to 32), Z85 and RFC 1924. It's possible to use a different encoding by specifying it in options object as a second parameter.

Similarly, it's possible to make encode add a delimiter (<~ and ~> for Adobe, xbtoa Begin and xbtoa End with newlines between the delimiters and encoded data for btoa. Checksums for btoa are not supported. Delimiters are not supported by other encodings.)

Functions

f
decodeAscii85(
ascii85: string,
options?: Ascii85Options
): Uint8Array

Decodes a given ascii85-encoded string.

f
encodeAscii85(
data: ArrayBuffer | Uint8Array | string,
options?: Ascii85Options
): string

Converts data into an ascii58-encoded string.

Interfaces

  • delimiter: boolean

    Whether to use a delimiter (if supported).

  • standard: Ascii85Standard

    Character set and delimiter (if supported and used).

Type Aliases

T
Ascii85Standard = "Adobe" | "btoa" | "RFC 1924" | "Z85"

Supported ascii85 standards for Ascii85Options.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/encoding

Import symbol

import * as mod from "@std/encoding/ascii85";
or

Import directly with a jsr specifier

import * as mod from "jsr:@std/encoding/ascii85";