Created 2 months ago
Maintained by steinar
base85 encoder and decoder in the style GNU coreutils base32 and base64
Members 1
Steinar Knutsen committed 2 months ago


Stream encoder and decoder of base85 as used in e.g. Mercurial. Run with ā€œ-h" for synopsis. base85 reads from stdin and writes to stdout. Default operation is encoding, swithch to decoding with the ā€œ-dā€ flag.


Python's base85 API works on bytes-like objects. By chunking the input and output streams, base85 avoids having to keep the entire file in memory. The resulting streams are identical to encoding or decoding an entire file in one invokation, though, as the program would be quite useless otherwise.


Running the program with PyPy instead of CPython showed a large increase in throughput on my system, so the runtime invoked by the hashbang is pypy3. Changing it to python3 should obviously have no other effects than lower throughput on large files.


base85 does not prettyprint its output. forcedeol is a small utility which blindly enforces no more than 80 octets between each newline character. Compile with something like:

gcc -Wall -O2 -oforcedeol forcedeol.c


Copyright 2019 Steinar Knutsen
Licensed under the EUPL