base85

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

base85

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.

base64.b85encode

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.

PyPy

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.

forcedeol

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

Licence

Copyright 2019 Steinar Knutsen
Licensed under the EUPL

https://joinup.ec.europa.eu/collection/eupl/eupl-guidelines-faq-infographics