docs/library/ubinascii: Update base64 docs.

This clarifies return values and the handling of invalid (e.g. newline)

Encoding conforms to RFC 3548, but decoding does not, as it ignores invalid
characters in base64 input. Instead, it conforms to MIME handling of base64
(RFC 2045).

Note that CPython doesn't document handling of invalid characters in
a2b_base64() docs: , so
we specify it more explicitly than it, based on CPython's actual behavior
(with which MicroPython now compliant).
Alex Robbins 6 years ago committed by Paul Sokolovsky
parent c89254fd0f
commit 0aa1d3f447

@ -29,8 +29,12 @@ Functions
.. function:: a2b_base64(data)
Convert Base64-encoded data to binary representation. Returns bytes string.
Decode base64-encoded data, ignoring invalid characters in the input.
Conforms to `RFC 2045 s.6.8 <>`_.
Returns a bytes object.
.. function:: b2a_base64(data)
Encode binary data in Base64 format. Returns string.
Encode binary data in base64 format, as in `RFC 3548
<>`_. Returns the encoded data
followed by a newline character, as a bytes object.