Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-101178: Add Ascii85, Base85, and Z85 support to binascii#102753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
05ae5adaa06c5d63774406c0e4a3ce4773c4072e3bbc9217f2c40ba0fd9eaf74746d18d0755936d65feca2413560df9a4060fbd7ca070887167e83e01df44278859181e928e32691a0ab9d27bd780517abc9a66ddc1d3fcc5de5a13bb3b186f09fa86d8f8973582492879dd863cdc3c58adaf2c2b2ecc4da165d1bf32f9974f6cebFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -86,6 +86,113 @@ The :mod:`binascii` module defines the following functions: | ||
| Added the *wrapcol* parameter. | ||
| .. function:: a2b_ascii85(string, /, *, fold_spaces=False, wrap=False, ignore=b"") | ||
| Convert Ascii85 data back to binary and return the binary data. | ||
| Valid Ascii85 data contains characters from the Ascii85 alphabet in groups | ||
| of five (except for the final group, which may have from two to five | ||
| characters). Each group encodes 32 bits of binary data in the range from | ||
| ``0`` to ``2 ** 32 - 1``, inclusive. The special character ``z`` is | ||
| accepted as a short form of the group ``!!!!!``, which encodes four | ||
| consecutive null bytes. | ||
| If *fold_spaces* is true, the special character ``y`` is also accepted as a | ||
| short form of the group ``+<VdL``, which encodes four consecutive spaces. | ||
| Note that neither short form is permitted if it occurs in the middle of | ||
| another group. | ||
| If *wrap* is true, the input begins with ``<~`` and ends with ``~>``, as in | ||
| the Adobe Ascii85 format. | ||
| *ignore* is an optional bytes-like object that specifies characters to | ||
| ignore in the input. | ||
| Invalid Ascii85 data will raise :exc:`binascii.Error`. | ||
| .. versionadded:: next | ||
| .. function:: b2a_ascii85(data, /, *, fold_spaces=False, wrap=False, width=0, pad=False) | ||
| Convert binary data to a formatted sequence of ASCII characters in Ascii85 | ||
| coding. The return value is the converted data. | ||
| If *fold_spaces* is true, four consecutive spaces are encoded as the | ||
| special character ``y`` instead of the sequence ``+<VdL``. | ||
| If *wrap* is true, the output begins with ``<~`` and ends with ``~>``, as | ||
| in the Adobe Ascii85 format. | ||
| If *width* is provided and greater than 0, the output is split into lines | ||
| of no more than the specified width separated by the ASCII newline | ||
| character. | ||
| If *pad* is true, the input is padded to a multiple of 4 before encoding. | ||
serhiy-storchaka marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| .. versionadded:: next | ||
| .. function:: a2b_base85(string, /, *, strict_mode=False) | ||
| Convert Base85 data back to binary and return the binary data. | ||
| More than one line may be passed at a time. | ||
| If *strict_mode* is true, only valid Base85 data will be converted. | ||
| Invalid Base85 data will raise :exc:`binascii.Error`. | ||
| Valid Base85 data contains characters from the Base85 alphabet in groups | ||
| of five (except for the final group, which may have from two to five | ||
| characters). Each group encodes 32 bits of binary data in the range from | ||
| ``0`` to ``2 ** 32 - 1``, inclusive. | ||
| .. versionadded:: next | ||
| .. function:: b2a_base85(data, /, *, pad=False, newline=True) | ||
| Convert binary data to a line of ASCII characters in Base85 coding. | ||
| The return value is the converted line. | ||
| If *pad* is true, the input is padded to a multiple of 4 before encoding. | ||
| If *newline* is true, a newline char is appended to the result. | ||
| .. versionadded:: next | ||
| .. function:: a2b_z85(string, /, *, strict_mode=False) | ||
| Convert Z85 data back to binary and return the binary data. | ||
| More than one line may be passed at a time. | ||
| If *strict_mode* is true, only valid Z85 data will be converted. | ||
| Invalid Z85 data will raise :exc:`binascii.Error`. | ||
| Valid Z85 data contains characters from the Z85 alphabet in groups | ||
| of five (except for the final group, which may have from two to five | ||
| characters). Each group encodes 32 bits of binary data in the range from | ||
| ``0`` to ``2 ** 32 - 1``, inclusive. | ||
serhiy-storchaka marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| See `Z85 specification <https://rfc.zeromq.org/spec/32/>`_ for more information. | ||
| .. versionadded:: next | ||
| .. function:: b2a_z85(data, /, *, pad=False, newline=True) | ||
| Convert binary data to a line of ASCII characters in Z85 coding. | ||
| The return value is the converted line. | ||
| If *pad* is true, the input is padded to a multiple of 4 before encoding. | ||
| If *newline* is true, a newline char is appended to the result. | ||
| See `Z85 specification <https://rfc.zeromq.org/spec/32/>`_ for more information. | ||
serhiy-storchaka marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| .. versionadded:: next | ||
| .. function:: a2b_qp(data, header=False) | ||
| Convert a block of quoted-printable data back to binary and return the binary | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.