@@ -146,13 +146,20 @@ POST request.
146146 Accepting the ``+ `` and ``/ `` characters is now deprecated.
147147
148148
149- .. function :: b32encode(s)
149+ .. function :: b32encode(s, *, wrapcol=0 )
150150
151151 Encode the :term: `bytes-like object ` *s * using Base32 and return the
152152 encoded :class: `bytes `.
153153
154+ If *wrapcol * is non-zero, insert a newline (``b'\n' ``) character
155+ after at most every *wrapcol * characters.
156+ If *wrapcol * is zero (default), do not add any newlines.
157+
158+ .. versionchanged :: next
159+ Added the *wrapcol * parameter.
160+
154161
155- .. function :: b32decode(s, casefold=False, map01=None)
162+ .. function :: b32decode(s, casefold=False, map01=None, *, ignorechars=b'' )
156163
157164 Decode the Base32 encoded :term: `bytes-like object ` or ASCII string *s * and
158165 return the decoded :class: `bytes `.
@@ -168,20 +175,29 @@ POST request.
168175 digit 0 is always mapped to the letter O). For security purposes the default is
169176 ``None ``, so that 0 and 1 are not allowed in the input.
170177
178+ *ignorechars * should be a :term: `bytes-like object ` containing characters
179+ to ignore from the input.
180+
171181 A :exc: `binascii.Error ` is raised if *s * is
172182 incorrectly padded or if there are non-alphabet characters present in the
173183 input.
174184
185+ .. versionchanged :: next
186+ Added the *ignorechars * parameter.
187+
175188
176- .. function :: b32hexencode(s)
189+ .. function :: b32hexencode(s, *, wrapcol=0 )
177190
178191 Similar to :func: `b32encode ` but uses the Extended Hex Alphabet, as defined in
179192 :rfc: `4648 `.
180193
181194 .. versionadded :: 3.10
182195
196+ .. versionchanged :: next
197+ Added the *wrapcol * parameter.
198+
183199
184- .. function :: b32hexdecode(s, casefold=False)
200+ .. function :: b32hexdecode(s, casefold=False, *, ignorechars=b'' )
185201
186202 Similar to :func: `b32decode ` but uses the Extended Hex Alphabet, as defined in
187203 :rfc: `4648 `.
@@ -193,14 +209,24 @@ POST request.
193209
194210 .. versionadded :: 3.10
195211
212+ .. versionchanged :: next
213+ Added the *ignorechars * parameter.
214+
196215
197- .. function :: b16encode(s)
216+ .. function :: b16encode(s, *, wrapcol=0 )
198217
199218 Encode the :term: `bytes-like object ` *s * using Base16 and return the
200219 encoded :class: `bytes `.
201220
221+ If *wrapcol * is non-zero, insert a newline (``b'\n' ``) character
222+ after at most every *wrapcol * characters.
223+ If *wrapcol * is zero (default), do not add any newlines.
224+
225+ .. versionchanged :: next
226+ Added the *wrapcol * parameter.
202227
203- .. function :: b16decode(s, casefold=False)
228+
229+ .. function :: b16decode(s, casefold=False, *, ignorechars=b'')
204230
205231 Decode the Base16 encoded :term: `bytes-like object ` or ASCII string *s * and
206232 return the decoded :class: `bytes `.
@@ -209,10 +235,17 @@ POST request.
209235 lowercase alphabet is acceptable as input. For security purposes, the default
210236 is ``False ``.
211237
238+ *ignorechars * should be a :term: `bytes-like object ` containing characters
239+ to ignore from the input.
240+
212241 A :exc: `binascii.Error ` is raised if *s * is
213242 incorrectly padded or if there are non-alphabet characters present in the
214243 input.
215244
245+ .. versionchanged :: next
246+ Added the *ignorechars * parameter.
247+
248+
216249.. _base64-base-85 :
217250
218251Base85 Encodings
@@ -277,27 +310,40 @@ Refer to the documentation of the individual functions for more information.
277310 .. versionadded :: 3.4
278311
279312
280- .. function :: b85encode(b, pad=False)
313+ .. function :: b85encode(b, pad=False, *, wrapcol=0 )
281314
282315 Encode the :term: `bytes-like object ` *b * using base85 (as used in e.g.
283316 git-style binary diffs) and return the encoded :class: `bytes `.
284317
285318 If *pad * is true, the input is padded with ``b'\0' `` so its length is a
286319 multiple of 4 bytes before encoding.
287320
321+ If *wrapcol * is non-zero, insert a newline (``b'\n' ``) character
322+ after at most every *wrapcol * characters.
323+ If *wrapcol * is zero (default), do not add any newlines.
324+
288325 .. versionadded :: 3.4
289326
327+ .. versionchanged :: next
328+ Added the *wrapcol * parameter.
290329
291- .. function :: b85decode(b)
330+
331+ .. function :: b85decode(b, *, ignorechars=b'')
292332
293333 Decode the base85-encoded :term: `bytes-like object ` or ASCII string *b * and
294334 return the decoded :class: `bytes `. Padding is implicitly removed, if
295335 necessary.
296336
337+ *ignorechars * should be a :term: `bytes-like object ` containing characters
338+ to ignore from the input.
339+
297340 .. versionadded :: 3.4
298341
342+ .. versionchanged :: next
343+ Added the *ignorechars * parameter.
344+
299345
300- .. function :: z85encode(s, pad=False)
346+ .. function :: z85encode(s, pad=False, *, wrapcol=0 )
301347
302348 Encode the :term: `bytes-like object ` *s * using Z85 (as used in ZeroMQ)
303349 and return the encoded :class: `bytes `. See `Z85 specification
@@ -306,20 +352,33 @@ Refer to the documentation of the individual functions for more information.
306352 If *pad * is true, the input is padded with ``b'\0' `` so its length is a
307353 multiple of 4 bytes before encoding.
308354
355+ If *wrapcol * is non-zero, insert a newline (``b'\n' ``) character
356+ after at most every *wrapcol * characters.
357+ If *wrapcol * is zero (default), do not add any newlines.
358+
309359 .. versionadded :: 3.13
310360
311361 .. versionchanged :: 3.15
312362 The *pad * parameter was added.
313363
364+ .. versionchanged :: next
365+ Added the *wrapcol * parameter.
366+
314367
315- .. function :: z85decode(s)
368+ .. function :: z85decode(s, *, ignorechars=b'' )
316369
317370 Decode the Z85-encoded :term: `bytes-like object ` or ASCII string *s * and
318371 return the decoded :class: `bytes `. See `Z85 specification
319372 <https://rfc.zeromq.org/spec/32/> `_ for more information.
320373
374+ *ignorechars * should be a :term: `bytes-like object ` containing characters
375+ to ignore from the input.
376+
321377 .. versionadded :: 3.13
322378
379+ .. versionchanged :: next
380+ Added the *ignorechars * parameter.
381+
323382
324383.. _base64-legacy :
325384
0 commit comments