The =<CR> is used to indicate that the last line of the b64 data is not terminate with a newline.

Both characters will be stripped when the data is decoded.

When b64 data is embedded in an email, it is wrapped (with a newline) every 76 (b64) characters. If the input data does not end with a newline, it is necessary to indicate this so that a newline is not appended when the data is decoded. ......=<cr> is the way this is done.

Update:Right conclusion (WAD), wrong interpretation. = characters are used by Base 64 to pad the last 1 or 2 bytes of data. Each 3 input bytes becomes 4 bytes of output. If there wasn't enough data in the last group of 3-bytes of the input, then the RFC calls for 1 or 2 '='s to be appended to the output to pad the group.

The <CR> is appended to the end of every line of output. Normally each line is <76 b64 chars><cr>, with the last line shorter as required.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Timing (and a little luck) are everything!


In reply to Re: MIME::Base64 is (working as designed) in 5.8.2 by BrowserUk
in thread MIME::Base64 is broken in 5.8.2? by pg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.