@@ -77,6 +77,79 @@ The :mod:`binascii` module defines the following functions:
77
77
Added the *newline * parameter.
78
78
79
79
80
+ .. function :: a2b_ascii85(string, /, *, fold_spaces=False, wrap=False, ignore=b"")
81
+
82
+ Convert Ascii85 data back to binary and return the binary data.
83
+
84
+ Valid Ascii85 data contains characters from the Ascii85 alphabet in groups
85
+ of five (except for the final group, which may have from two to five
86
+ characters). Each group encodes 32 bits of binary data in the range from
87
+ ``0 `` to ``2 ** 32 - 1 ``, inclusive. The special character ``z `` is
88
+ accepted as a short form of the group ``!!!!! ``, which encodes four
89
+ consecutive null bytes.
90
+
91
+ If *fold_spaces * is true, the special character ``y `` is also accepted as a
92
+ short form of the group ``+<VdL ``, which encodes four consecutive spaces.
93
+ Note that neither short form is permitted if it occurs in the middle of
94
+ another group.
95
+
96
+ If *wrap * is true, the input begins with ``<~ `` and ends with ``~> ``, as in
97
+ the Adobe Ascii85 format.
98
+
99
+ *ignore * is an optional bytes-like object that specifies characters to
100
+ ignore in the input.
101
+
102
+ Invalid Ascii85 data will raise :exc: `binascii.Error `.
103
+
104
+
105
+ .. function :: b2a_ascii85(data, /, *, fold_spaces=False, wrap=False, width=0, pad=False)
106
+
107
+ Convert binary data to a formatted sequence of ASCII characters in Ascii85
108
+ coding. The return value is the converted data.
109
+
110
+ If *fold_spaces * is true, four consecutive spaces are encoded as the
111
+ special character ``y `` instead of the sequence ``+<VdL ``.
112
+
113
+ If *wrap * is true, the output begins with ``<~ `` and ends with ``~> ``, as
114
+ in the Adobe Ascii85 format.
115
+
116
+ If *width * is provided and greater than 0, the output is split into lines
117
+ of no more than the specified width separated by the ASCII newline
118
+ character.
119
+
120
+ If *pad * is true, the input is padded to a multiple of 4 before encoding.
121
+
122
+
123
+ .. function :: a2b_base85(string, /, *, strict_mode=False, z85=False)
124
+
125
+ Convert base85 data back to binary and return the binary data.
126
+ More than one line may be passed at a time.
127
+
128
+ If *strict_mode * is true, only valid base85 data will be converted.
129
+ Invalid base85 data will raise :exc: `binascii.Error `.
130
+
131
+ If *z85 * is true, the base85 data uses the Z85 alphabet.
132
+ See `Z85 specification <https://rfc.zeromq.org/spec/32/ >`_ for more information.
133
+
134
+ Valid base85 data contains characters from the base85 alphabet in groups
135
+ of five (except for the final group, which may have from two to five
136
+ characters). Each group encodes 32 bits of binary data in the range from
137
+ ``0 `` to ``2 ** 32 - 1 ``, inclusive.
138
+
139
+
140
+ .. function :: b2a_base85(data, /, *, pad=False, newline=True, z85=False)
141
+
142
+ Convert binary data to a line of ASCII characters in base85 coding.
143
+ The return value is the converted line.
144
+
145
+ If *pad * is true, the input is padded to a multiple of 4 before encoding.
146
+
147
+ If *newline * is true, a newline char is appended to the result.
148
+
149
+ If *z85 * is true, the Z85 alphabet is used for conversion.
150
+ See `Z85 specification <https://rfc.zeromq.org/spec/32/ >`_ for more information.
151
+
152
+
80
153
.. function :: a2b_qp(data, header=False)
81
154
82
155
Convert a block of quoted-printable data back to binary and return the binary
0 commit comments