2
2
===============================================================
3
3
4
4
.. module :: base64
5
- :synopsis: RFC 3548 : Base16, Base32, Base64 Data Encodings;
5
+ :synopsis: RFC 4648 : Base16, Base32, Base64 Data Encodings;
6
6
Base85 and Ascii85
7
7
8
8
**Source code: ** :source: `Lib/base64.py `
16
16
This module provides functions for encoding binary data to printable
17
17
ASCII characters and decoding such encodings back to binary data.
18
18
It provides encoding and decoding functions for the encodings specified in
19
- :rfc: `3548 `, which defines the Base16, Base32, and Base64 algorithms,
19
+ :rfc: `4648 `, which defines the Base16, Base32, and Base64 algorithms,
20
20
and for the de-facto standard Ascii85 and Base85 encodings.
21
21
22
- The :rfc: `3548 ` encodings are suitable for encoding binary data so that it can
22
+ The :rfc: `4648 ` encodings are suitable for encoding binary data so that it can
23
23
safely sent by email, used as parts of URLs, or included as part of an HTTP
24
24
POST request. The encoding algorithm is not the same as the
25
25
:program: `uuencode ` program.
@@ -28,7 +28,7 @@ There are two interfaces provided by this module. The modern interface
28
28
supports encoding :term: `bytes-like objects <bytes-like object> ` to ASCII
29
29
:class: `bytes `, and decoding :term: `bytes-like objects <bytes-like object> ` or
30
30
strings containing ASCII to :class: `bytes `. Both base-64 alphabets
31
- defined in :rfc: `3548 ` (normal, and URL- and filesystem-safe) are supported.
31
+ defined in :rfc: `4648 ` (normal, and URL- and filesystem-safe) are supported.
32
32
33
33
The legacy interface does not support decoding from strings, but it does
34
34
provide functions for encoding and decoding to and from :term: `file objects
@@ -124,12 +124,13 @@ The modern interface provides:
124
124
whether a lowercase alphabet is acceptable as input. For security purposes,
125
125
the default is ``False ``.
126
126
127
- :rfc: ` 3548 ` allows for optional mapping of the digit 0 (zero) to the letter O
127
+ One might desire an optional mapping of the digit 0 (zero) to the letter O
128
128
(oh), and for optional mapping of the digit 1 (one) to either the letter I (eye)
129
129
or letter L (el). The optional argument *map01 * when not ``None ``, specifies
130
130
which letter the digit 1 should be mapped to (when *map01 * is not ``None ``, the
131
131
digit 0 is always mapped to the letter O). For security purposes the default is
132
- ``None ``, so that 0 and 1 are not allowed in the input.
132
+ ``None ``, so that 0 and 1 are not allowed in the input. Note that :rfc: `4648 `
133
+ (which made :rfc: `3548 ` obsolete) did not allow such a mapping.
133
134
134
135
A :exc: `binascii.Error ` is raised if *s * is
135
136
incorrectly padded or if there are non-alphabet characters present in the
0 commit comments