Base84 deserves a place in file names
TurboCrypt, a file encryption tool initially crafted for Unix systems, employed Base91 encoding for file names. This method generated strings suitable for storage as legitimate files on Unix and macOS. However, the macOS Finder posed issues with such names. With the demand for Windows compatibility arose, certain characters in Unix's safe alphabet became forbidden. Base91, being a perfect fit for portable filesystem-safe names, became a promising solution.
The Base91 encoding algorithm operates in 5-character groups. On average, this results in a 25.2% expansion of the binary input. For a maximum-length name that can hold 197 bytes of input, Base84 ensures no bit loss compared to 191 bytes for unpadded Base64. Unix filenames contain punctuation that Windows rejects, such as NUL and /. A variant of zig-base91 replaces the slash with an apostrophe, increasing the packing efficiency by 6.51 bits per character, leading to approximately 23% expansion.
This encoding method not only avoids Windows reserved device names but also ensures no padding or special handling is required to prevent these names. Consequently, Base84 emerges as a suitable choice for file names across various filesystems.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
