Xxencoding
Xxencode is a binary to text encoding similar to Uuencode which uses only the alphanumeric characters, and the plus and minus signs. It was invented as a means to transfer files in a format which would survive character set translation.
The Encoding Process
Xxencoded data starts with a line of the form:
begin <mode> <file>
Where <mode> is the file's read/write/execute permissions as three octal digits, and <file> is the name to be used when recreating the binary data.
Xxencode repeatedly takes in groups of three bytes, adding trailing zeroes if there are fewer than three bytes left. These 24 bits are split into four 6-bit numbers, each of which is then translated to the th character in the following table:
+-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
Each group of sixty output characters (corresponding to 45 input bytes) is output as a separate line preceded by an encoded character giving the number of encoded bytes on that line. For all lines except the last, this will be the character 'M' (ASCII code 77 = 32+45). If the input is not evenly divisible by 45, the last line will contain the remaining N output characters, preceded by the character whose code is 32 + the number of remaining input bytes. Finally, a line containing just a single space (or grave character) is output, followed by one line containing the string "end".
External Links
- xxencode.c - C source code for a program to perform Xxencoding.
- xxdecode.c - C source code for a program to perform Xxdecoding.