Data encodings used to transmit binary information via text only systems (email, etc...)
This filter decodes data that has been encoded in the ASCII base- 85 encoding and produces binary data.ASCII base- 85 encoding produces five ASCII printing characters from every four bytes of binary data. Each group of four binary bytes (b1 b2 b3 b4 ) is converted to a group of five encoded characters (c1 c2 c3 c4 c5 ) using the relation:
The five digits of the encoded base- 85 number are converted to printable ASCII characters by adding 33 (the ASCII code for !) to each. The resulting data contains only printable ASCII characters with codes in the range 33 (!) to 117 (u).
Two special cases occur during encoding. First, if all five encoded digits are zero, they are represented by the character code 122 (z), instead of by a series of five exclamation points (!!!!!). In addition, if the length of the binary data to be encoded is not a multiple of four bytes, the last partial 4- tuple is used to produce a last, partial output 5- tuple. Given n (1, 2, or 3) bytes of binary data, the encoding first appends 4 n zero bytes to make a complete 4- tuple. This 4- tuple is encoded in the usual way, but without applying the special z case. Finally, only the first n + 1 characters of the resulting 5- tuple are written out. Those characters are immediately followed by the EOD marker, which is the two- character sequence ~>.
The following conditions are errors during decoding: The value represented by a 5- tuple is greater than 2 32 1. A z character occurs in the middle of a 5- tuple. A final partial 5- tuple contains only one character. These conditions never occur in the output produced from a correctly encoded byte sequence.
Most effecient use of available characters when encoding truly binary data. Least Safe. Adobe technical support database notes that you may need to use mime (Base64) encoding to send pdf files on AOL. ~25%
NPL c code for mime encode with Base64 and Quote Printable
MASM 32 bit code for a base64 variant
see also:
MIME (Multi-purpose Internet Mail Extensions) comprises the IETF specifications RFC 822 (?)(now RFCs 2045 to 2049)
The Base64 Content-Transfer-Encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. The encoding and decoding algorithms are simple, but the encoded data are consistently only about 33 percent larger than the uncoded data. This encoding is virtually identical to the one used in Privacy Enhanced Mail (PEM) applications, as defined in RFC 1421.
UUencode is a text-based binary encryption protocol in wide use for the transfer of 8 bit binary files via the 7-bit Internet.
Bin/Hex is the protocol used to transfer both resource and data forks.
See:
Comments:
.