diff options
| author | Christian Decker <christian.decker@lookslikematrix.de> | 2022-01-15 15:19:59 +0100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-01-23 10:18:01 +1100 |
| commit | 2e3a2785cdd5c63788cac7ec8b5d62105ecfe4aa (patch) | |
| tree | ddf0a14ffd5d4d7ae875c8d3676a324f3604c12d /docs/library | |
| parent | aafd8859e9f0a2b5cc49e41a50530fecec79a205 (diff) | |
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>
Diffstat (limited to 'docs/library')
| -rw-r--r-- | docs/library/binascii.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/library/binascii.rst b/docs/library/binascii.rst index fc621a8ab..6c02f019a 100644 --- a/docs/library/binascii.rst +++ b/docs/library/binascii.rst @@ -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. |
