Encodings

Base85

Base 85 with the RFC 1924 alphabet in four byte groups. What Python b85encode and Mercurial write
IDbase8516 / 21base85 · 85 characters
Encoding / Base85

Base85

The RFC 1924 alphabet in four byte groups.

Overhead
+25% on random bytes
Padding
none
Standard
RFC 1924 alphabet, git binary patch grouping
Used by
Python, Mercurial, git patches
family 3 / 21

Sample

Out
Xk~0{Zy<MXa%^NF
Back
"hello world!"

Access

Importimport { base85 } from "@agntn/encodings/base85"
CLIencodings encode base85 'hello world!'
Tryplayground with the sample above
Kinascii85, z85

RFC 1924 came out on 1 April 1996. It wanted every IPv6 address as one 128-bit number in base 85. Notice the date? Nobody writes IPv6 that way. The alphabet stuck anyway.

ts
encode("base85", "hello world");  // "Xk~0{Zy<MXa%^M"

This is the form people actually meet: four bytes as five characters, like Ascii85, with a short last group cut. Python's b85encode writes it, and so does Mercurial. Git binary patches use the same alphabet and groups, with a length character in front of every line.

Not like Ascii85: no z for zeros, no <~ ~>, and whitespace is an error. Python doesn't skip it either. Ask for base85 and you get this one. a85 still means Ascii85.