@@ -109,38 +109,41 @@ The :mod:`binascii` module defines the following functions:
109109 accepted as a short form of the group ``!!!!! ``, which encodes four
110110 consecutive null bytes.
111111
112- If *foldspaces * is true, the special character ``y `` is also accepted as a
113- short form of the group ``+<VdL ``, which encodes four consecutive spaces.
114- Note that neither short form is permitted if it occurs in the middle of
115- another group.
112+ *foldspaces * is a flag that specifies whether the 'y' short sequence
113+ should be accepted as shorthand for 4 consecutive spaces (ASCII 0x20).
114+ This feature is not supported by the "standard" Ascii85 encoding.
116115
117- If * ignorechars * is true, the input begins with `` <~ `` and ends with `` ~> ``, as in
118- the Adobe Ascii85 format .
116+ * adobe * controls whether the input sequence is in Adobe Ascii85 format
117+ (i.e. is framed with <~ and ~>) .
119118
120- *ignorechars * is an optional bytes-like object that specifies characters to
121- ignore in the input.
119+ *ignorechars * should be a :term: `bytes-like object ` containing characters
120+ to ignore from the input.
121+ This should only contain whitespace characters.
122122
123123 Invalid Ascii85 data will raise :exc: `binascii.Error `.
124124
125125 .. versionadded :: next
126126
127127
128- .. function :: b2a_ascii85(data, /, *, foldspaces=False, adobe=False, wrapcol=0, pad=False)
128+ .. function :: b2a_ascii85(data, /, *, foldspaces=False, wrapcol=0, pad=False, adobe =False)
129129
130130 Convert binary data to a formatted sequence of ASCII characters in Ascii85
131131 coding. The return value is the converted data.
132132
133- If *foldspaces * is true, four consecutive spaces are encoded as the
134- special character ``y `` instead of the sequence ``+<VdL ``.
133+ *foldspaces * is an optional flag that uses the special short sequence 'y'
134+ instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
135+ feature is not supported by the "standard" Ascii85 encoding.
135136
136- If *adobe * is true, the output begins with ``<~ `` and ends with ``~> ``, as
137- in the Adobe Ascii85 format.
137+ If *wrapcol * is non-zero, insert a newline (``b'\n' ``) character
138+ after at most every *wrapcol * characters.
139+ If *wrapcol * is zero (default), do not insert any newlines.
138140
139- If *wrapcol * is provided and greater than 0, the output is split into lines
140- of no more than the specified width separated by the ASCII newline
141- character .
141+ If *pad * is true, the input is padded with `` b'\0' `` so its length is a
142+ multiple of 4 bytes before encoding.
143+ Note that the `` btoa `` implementation always pads .
142144
143- If *pad * is true, the input is padded to a multiple of 4 before encoding.
145+ *adobe * controls whether the encoded byte sequence is framed with ``<~ ``
146+ and ``~> ``, which is used by the Adobe implementation.
144147
145148 .. versionadded :: next
146149
@@ -150,12 +153,13 @@ The :mod:`binascii` module defines the following functions:
150153 Convert Base85 data back to binary and return the binary data.
151154 More than one line may be passed at a time.
152155
153- Invalid Base85 data will raise :exc: `binascii.Error `.
154156 Valid Base85 data contains characters from the Base85 alphabet in groups
155157 of five (except for the final group, which may have from two to five
156158 characters). Each group encodes 32 bits of binary data in the range from
157159 ``0 `` to ``2 ** 32 - 1 ``, inclusive.
158160
161+ Invalid Base85 data will raise :exc: `binascii.Error `.
162+
159163 .. versionadded :: next
160164
161165
@@ -164,7 +168,8 @@ The :mod:`binascii` module defines the following functions:
164168 Convert binary data to a line of ASCII characters in Base85 coding.
165169 The return value is the converted line.
166170
167- If *pad * is true, the input is padded to a multiple of 4 before encoding.
171+ If *pad * is true, the input is padded with ``b'\0' `` so its length is a
172+ multiple of 4 bytes before encoding.
168173
169174 .. versionadded :: next
170175
@@ -174,14 +179,15 @@ The :mod:`binascii` module defines the following functions:
174179 Convert Z85 data back to binary and return the binary data.
175180 More than one line may be passed at a time.
176181
177- Invalid Z85 data will raise :exc: `binascii.Error `.
178182 Valid Z85 data contains characters from the Z85 alphabet in groups
179183 of five (except for the final group, which may have from two to five
180184 characters). Each group encodes 32 bits of binary data in the range from
181185 ``0 `` to ``2 ** 32 - 1 ``, inclusive.
182186
183187 See `Z85 specification <https://rfc.zeromq.org/spec/32/ >`_ for more information.
184188
189+ Invalid Z85 data will raise :exc: `binascii.Error `.
190+
185191 .. versionadded :: next
186192
187193
@@ -190,7 +196,8 @@ The :mod:`binascii` module defines the following functions:
190196 Convert binary data to a line of ASCII characters in Z85 coding.
191197 The return value is the converted line.
192198
193- If *pad * is true, the input is padded to a multiple of 4 before encoding.
199+ If *pad * is true, the input is padded with ``b'\0' `` so its length is a
200+ multiple of 4 bytes before encoding.
194201
195202 See `Z85 specification <https://rfc.zeromq.org/spec/32/ >`_ for more information.
196203
0 commit comments