Encodings
Ascii85
Four bytes as five characters from ! to u with z for four zero bytes. PostScript and PDF
Encoding / Base85
Ascii85
Four bytes as five, z for zeros.
- Overhead
- +25% on random bytes
- Padding
- none
- Standard
- Adobe PostScript Language Reference, ASCII85Decode
- Used by
- PostScript, PDF
family 2 / 20
Sample
- Out
- BOu!rD]j7BEbo80
- Back
- "hello world!"
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu
Options
Access
- Import
import { ascii85 } from "@agntn/encodings/base85" - CLI
encodings encode ascii85 'hello world!' - Tryplayground with the sample above
- Kinz85
Adobe's base85 from PostScript and PDF. Four bytes become one 32-bit number. That number goes out as five digits from ! to u.
encode("ascii85", "Hello, World!"); // "87cURD_*#4DfTZ)+T"
encode("ascii85", "Hello, World!", { delimiters: true }); // "<~87cURD_*#4DfTZ)+T~>"
encode("ascii85", new Uint8Array(4)); // "z"
Four zero bytes are a single z, a small gift for sparse data. Decoding takes the <~ ~> wrapper or not, and skips whitespace. A z in the middle of a group is an error. Can five digits overflow 32 bits? uuuuu can, and it's refused.