3 ms·
Base85 uses ASCII characters 33 (“!”) through 117 (“u”), which includes a number of inconvenient characters, like backslash and single and double quotes. The re
by layer8 3y ago
Base85 uses ASCII characters 33 (“!”) through 117 (“u”), which includes a number of inconvenient characters, like backslash and single and double quotes. The reason to use an encoding at all instead of just raw binary is not just to avoid nonprintable characters, but also to avoid certain printable characters with meta semantics, like string delimiters and escape characters.
An alternative would be the encoding specified by RFC 1924, which uses a different, noncontiguous set of characters. It still has the drawback that dividing by 85 is a bit slower than dividing by 64 (which is just a bit shift).
Last but not least, Base64 has the benefit of being easily recognizable by a human. Due to its relatively restricted character set, it doesn’t look like just line noise, but also doesn’t look like more intelligible syntax, or like hex, etc. It sits in a middle sweet spot.