root WRITEUP Base256

Base256

An encoding scheme from binary to a printable superset of printable ASCII 2024-03-10

Base256 Note • convert.py

The Base256 note contains an overview of the Base256 encoding scheme. The main idea is to store data on sheets of paper as a ridiculously future-proof backup medium by converting binary data into printable characters while maintaining backwards compatibility with printable ASCII.

I wrote a quick script that implements the Base256 encoding scheme and outputs from a template an HTML file to be printed. Unfortunately, both Chromium and Firefox tend to grind to a halt attempting to print a document with more than a few hundred inline b tags. You live and you learn.

Looking back, I’m not too sure what I was thinking when coming up with Base256. It’s a solved problem—look at percent-encoding for URIs and \ escape sequences for string literals. To demonstrate my point, here’s a Python one-liner that achieves the same goals as Base256:

# for strings make sure to first `.encode()` to bytes
lambda bytes: repr(bytes)[2:-1].replace(' ', '\u2e31')