mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
extmod/modubinascii: Add newline keyword to b2a_base64 function.
This allows encoding things (eg a Basic-Auth header for a request) without slicing the \n from the string, which allocates additional memory. Co-authored-by: David Lechner <david@lechnology.com>
This commit is contained in:
committed by
Damien George
parent
aafd8859e9
commit
2e3a2785cd
@@ -31,8 +31,8 @@ Functions
|
||||
Conforms to `RFC 2045 s.6.8 <https://tools.ietf.org/html/rfc2045#section-6.8>`_.
|
||||
Returns a bytes object.
|
||||
|
||||
.. function:: b2a_base64(data)
|
||||
.. function:: b2a_base64(data, *, newline=True)
|
||||
|
||||
Encode binary data in base64 format, as in `RFC 3548
|
||||
<https://tools.ietf.org/html/rfc3548.html>`_. Returns the encoded data
|
||||
followed by a newline character, as a bytes object.
|
||||
followed by a newline character if newline is true, as a bytes object.
|
||||
|
||||
Reference in New Issue
Block a user