mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
whatsnew: base65 encodings. (#17618)
Also updated the base64 module title and introduction to adjust for the fact that these new encodings are included. Also adjusted the wording about the base64 alphabets (see issue #20837).
This commit is contained in:
parent
9bd6a37df2
commit
c210de1ea1
2 changed files with 27 additions and 13 deletions
|
@ -1,27 +1,33 @@
|
||||||
:mod:`base64` --- RFC 3548: Base16, Base32, Base64 Data Encodings
|
:mod:`base64` --- Base16, Base32, Base64, Base85 Data Encodings
|
||||||
=================================================================
|
===============================================================
|
||||||
|
|
||||||
.. module:: base64
|
.. module:: base64
|
||||||
:synopsis: RFC 3548: Base16, Base32, Base64 Data Encodings
|
:synopsis: RFC 3548: Base16, Base32, Base64 Data Encodings;
|
||||||
|
Base85 and Ascii85
|
||||||
|
|
||||||
|
|
||||||
.. index::
|
.. index::
|
||||||
pair: base64; encoding
|
pair: base64; encoding
|
||||||
single: MIME; base64 encoding
|
single: MIME; base64 encoding
|
||||||
|
|
||||||
This module provides data encoding and decoding as specified in :rfc:`3548`.
|
This module provides functions for encoding binary data to printable
|
||||||
This standard defines the Base16, Base32, and Base64 algorithms for encoding
|
ASCII characters and decoding such encodings back to binary data.
|
||||||
and decoding arbitrary binary strings into ASCII-only byte strings that can be
|
It provides encoding and decoding functions for the encodings specified in
|
||||||
|
in :rfc:`3548`, which defines the Base16, Base32, and Base64 algorithms,
|
||||||
|
and for the de-facto standard Ascii85 and Base85 encodings.
|
||||||
|
|
||||||
|
The :rfc:`3548` encodings are suitable for encoding binary data so that it can
|
||||||
safely sent by email, used as parts of URLs, or included as part of an HTTP
|
safely sent by email, used as parts of URLs, or included as part of an HTTP
|
||||||
POST request. The encoding algorithm is not the same as the
|
POST request. The encoding algorithm is not the same as the
|
||||||
:program:`uuencode` program.
|
:program:`uuencode` program.
|
||||||
|
|
||||||
There are two interfaces provided by this module. The modern interface
|
There are two :rfc:`3548` interfaces provided by this module. The modern
|
||||||
supports encoding and decoding ASCII byte string objects using all three
|
interface supports encoding and decoding ASCII byte string objects using all
|
||||||
alphabets. Additionally, the decoding functions of the modern interface also
|
three :rfc:`3548` defined alphabets (normal, URL-safe, and filesystem-safe).
|
||||||
accept Unicode strings containing only ASCII characters. The legacy interface
|
Additionally, the decoding functions of the modern interface also accept
|
||||||
provides for encoding and decoding to and from file-like objects as well as
|
Unicode strings containing only ASCII characters. The legacy interface provides
|
||||||
byte strings, but only using the Base64 standard alphabet.
|
for encoding and decoding to and from file-like objects as well as byte
|
||||||
|
strings, but only using the Base64 standard alphabet.
|
||||||
|
|
||||||
.. versionchanged:: 3.3
|
.. versionchanged:: 3.3
|
||||||
ASCII-only Unicode strings are now accepted by the decoding functions of
|
ASCII-only Unicode strings are now accepted by the decoding functions of
|
||||||
|
@ -29,7 +35,7 @@ byte strings, but only using the Base64 standard alphabet.
|
||||||
|
|
||||||
.. versionchanged:: 3.4
|
.. versionchanged:: 3.4
|
||||||
Any :term:`bytes-like object`\ s are now accepted by all
|
Any :term:`bytes-like object`\ s are now accepted by all
|
||||||
encoding and decoding functions in this module.
|
encoding and decoding functions in this module. Ascii85/Base85 support added.
|
||||||
|
|
||||||
The modern interface provides:
|
The modern interface provides:
|
||||||
|
|
||||||
|
|
|
@ -583,6 +583,14 @@ The encoding and decoding functions in :mod:`base64` now accept any
|
||||||
:class:`bytes` or :class:`bytearray` instance. (Contributed by Nick Coghlan in
|
:class:`bytes` or :class:`bytearray` instance. (Contributed by Nick Coghlan in
|
||||||
:issue:`17839`.)
|
:issue:`17839`.)
|
||||||
|
|
||||||
|
New functions :func:`~base64.a85encode`, :func:`~base64.a85decode`,
|
||||||
|
:func:`~base64.b85encode`, and :func:`~base64.b85decode` provide the ability to
|
||||||
|
encode and decode binary data from and to ``Ascii85`` and the git/mercurial
|
||||||
|
``Base85`` formats, respectively. The ``a85`` functions have options that can
|
||||||
|
be sued to make them compatible with the variants of the ``Ascii85`` encoding,
|
||||||
|
including the Adobe variant. (Contributed by Martin Morrison, the Mercurial
|
||||||
|
project, Serhiy Storchaka, and Antoine Pitrou in :issue:`17618`.)
|
||||||
|
|
||||||
|
|
||||||
colorsys
|
colorsys
|
||||||
--------
|
--------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue