uuencoding

uuencoding is a form of binary-to-text encoding that originated in the Unix programs uuencode and uudecode written by Mary Ann Horton at the University of California, Berkeley in 1980,[1] for encoding binary data for transmission in email systems.

The program uudecode reverses the effect of uuencode, recreating the original binary file exactly.

uuencode/decode became popular for sending binary (and especially compressed) files by email and posting to Usenet newsgroups, etc.

uudecoding is reverse of the above, subtract 32 from each character's ASCII code (modulo 64 to account for the grave accent usage) to get a 6-bit value, concatenate 4 6-bit groups to get 24 bits, then output 3 bytes.

Mac OS HFS+ supports multiple forks, as does Microsoft Windows NTFS alternate data streams.

uuencoding takes 3 pre-formatted bytes and turns them into 4 and also adds begin/end tags, filename, and delimiters.

This adds at least 33% data overhead compared to the source alone, though this can be at least somewhat compensated for by compressing the file before uuencoding it.

The Python language supports uuencoding using the codecs module with the codec "uu": For Python 2 (deprecated/sunset as of January 1st 2020): For Python 3 where the codecs module needs to be imported and used directly: To decode, pass the whole file: The Perl language supports uuencoding natively using the pack() and unpack() operators with the format string "u": Decoding base64 with unpack can likewise be accomplished by translating the characters: To produce wellformed uuencoded files, you need to use modules,[3] or a little bit more of code:[4] https://metacpan.org/dist/PerlPowerTools/view/bin/uuencode https://metacpan.org/dist/PerlPowerTools/view/bin/uudecode