Decoder.
Decoder. Supports all the variants produced by the encoder above, but does not tolerate any other illegal characters, including line breaks at positions other than 76-char boundaries, in which case the result will be garbage.
Encoder.
Encoder. The RFC requires that line breaks be added every 76 chars, and that the data be padded to a multiple of 4 chars, but we do these things optionally.
RFC2045 base-64 codec, based on http://migbase64.sourceforge.net/.