ietf-822
[Top] [All Lists]

Re: encodings, base-64, etc.

1991-10-29 15:54:10
No real specs on the format itself.  A quick look at the code reveals
that it's simpler than I thought.  Ignoring trivia like header conventions:

This _is_ BASE64, in all but a few minor details.

- The main alphabet is "A-Za-z0-9+-", 64 characters total.

This is identical to the BASE64 encoding, except BASE64 uses / instead of -.
Both of these characters are in the minimal invariant subset of ASCII and
both are allowed in an RFC822 atom; I see no advantage to using one over the
other.

- Data is encoded by assembling three 8-bit bytes into 24 bits, filling
      the high end first, and then putting this out as four characters
      conveying six bits each, starting from the high end.

Exactly like BASE64.

- Lines are broken after the 77th character on each, to keep length down.

77 is a bit long. BASE64 recommends 64, but a BASE64 decoder must be able to
accept 77 character lines.

- At end of data, any partial line is ended and two terminating lines
      are generated.  The first consists of a slash "/", a one-digit
      number indicating how many bytes are left after the last 24-bit
      clump, and the hexadecimal values of those bytes.  The second
      consists of a decimal total byte count, a space, and a hex 16-bit
      CRC which the comments claim to be CRC-16.

This differs substantially from BASE64; see the RFC for details. Apart from the
checksum, which I don't think belongs in the data stream because it does not
generalize cleanly to other encodings, there is no advantage to this way of
doing business that BASE64 lacks. This method has the disadvantage that it
uses a second encoding (hex) and I don't see why a second encoding should
be instroduced.

Receiving basically just reverses the process, ignoring any character
(including newlines) that is not in the main alphabet until the slash
is seen.

Exactly the same.

This stuff has been used successfully in production news transfers (muchos
megabytes) over Bitnet mail.

As has BASE64. I use it all the time over BITNET. It works just fine.

                                        Ned


<Prev in Thread] Current Thread [Next in Thread>