Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(41060)

Delta Between Two Patch Sets: Doc/library/base64.rst

Issue 17839: base64 module should use memoryview
Left Patch Set: Created 6 years, 4 months ago
Right Patch Set: Created 6 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Doc/library/codecs.rst » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 :mod:`base64` --- RFC 3548: Base16, Base32, Base64 Data Encodings 1 :mod:`base64` --- RFC 3548: Base16, Base32, Base64 Data Encodings
2 ================================================================= 2 =================================================================
3 3
4 .. module:: base64 4 .. module:: base64
5 :synopsis: RFC 3548: Base16, Base32, Base64 Data Encodings 5 :synopsis: RFC 3548: Base16, Base32, Base64 Data Encodings
6 6
7 7
8 .. index:: 8 .. index::
9 pair: base64; encoding 9 pair: base64; encoding
10 single: MIME; base64 encoding 10 single: MIME; base64 encoding
11 11
12 This module provides data encoding and decoding as specified in :rfc:`3548`. 12 This module provides data encoding and decoding as specified in :rfc:`3548`.
13 This standard defines the Base16, Base32, and Base64 algorithms for encoding 13 This standard defines the Base16, Base32, and Base64 algorithms for encoding
14 and decoding arbitrary binary strings into ASCII-only byte strings that can be 14 and decoding arbitrary binary strings into ASCII-only byte strings that can be
15 safely sent by email, used as parts of URLs, or included as part of an HTTP 15 safely sent by email, used as parts of URLs, or included as part of an HTTP
16 POST request. The encoding algorithm is not the same as the 16 POST request. The encoding algorithm is not the same as the
17 :program:`uuencode` program. 17 :program:`uuencode` program.
18 18
19 There are two interfaces provided by this module. The modern interface 19 There are two interfaces provided by this module. The modern interface
20 supports encoding and decoding ASCII byte string objects using all three 20 supports encoding and decoding ASCII byte string objects using all three
21 alphabets. Additionally, the decoding functions of the modern interface also 21 alphabets. Additionally, the decoding functions of the modern interface also
22 accept Unicode strings containing only ASCII characters. The legacy interface 22 accept Unicode strings containing only ASCII characters. The legacy interface
23 provides for encoding and decoding to and from file-like objects as well as 23 provides for encoding and decoding to and from file-like objects as well as
24 byte strings, but only using the Base64 standard alphabet. 24 byte strings, but only using the Base64 standard alphabet.
25 25
26 .. versionchanged:: 3.3 26 .. versionchanged:: 3.3
27 ASCII-only Unicode strings are now accepted by the decoding functions of 27 ASCII-only Unicode strings are now accepted by the decoding functions of
28 the modern interface. 28 the modern interface.
29
30 .. versionchanged:: 3.4
31 Any :term:`bytes-like object`\ s are now accepted by all
32 encoding and decoding functions in this module.
29 33
30 The modern interface provides: 34 The modern interface provides:
31 35
32 .. function:: b64encode(s, altchars=None) 36 .. function:: b64encode(s, altchars=None)
33 37
34 Encode a byte string using Base64. 38 Encode a byte string using Base64.
35 39
36 *s* is the string to encode. Optional *altchars* must be a string of at leas t 40 *s* is the string to encode. Optional *altchars* must be a string of at leas t
37 length 2 (additional characters are ignored) which specifies an alternative 41 length 2 (additional characters are ignored) which specifies an alternative
38 alphabet for the ``+`` and ``/`` characters. This allows an application to e .g. 42 alphabet for the ``+`` and ``/`` characters. This allows an application to e .g.
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 184
181 .. seealso:: 185 .. seealso::
182 186
183 Module :mod:`binascii` 187 Module :mod:`binascii`
184 Support module containing ASCII-to-binary and binary-to-ASCII conversions. 188 Support module containing ASCII-to-binary and binary-to-ASCII conversions.
185 189
186 :rfc:`1521` - MIME (Multipurpose Internet Mail Extensions) Part One: Mechanis ms for Specifying and Describing the Format of Internet Message Bodies 190 :rfc:`1521` - MIME (Multipurpose Internet Mail Extensions) Part One: Mechanis ms for Specifying and Describing the Format of Internet Message Bodies
187 Section 5.2, "Base64 Content-Transfer-Encoding," provides the definition o f the 191 Section 5.2, "Base64 Content-Transfer-Encoding," provides the definition o f the
188 base64 encoding. 192 base64 encoding.
189 193
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+