]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-101178: Add Ascii85, Base85, and Z85 support to binascii (GH-102753)
authorkangtastic <942136+kangtastic@users.noreply.github.com>
Fri, 6 Feb 2026 14:43:16 +0000 (06:43 -0800)
committerGitHub <noreply@github.com>
Fri, 6 Feb 2026 14:43:16 +0000 (16:43 +0200)
commit45d4a347205ede4568d912edf820e4de80213392
tree1274879592e4032b096d20fc793b8c2b66e873b0
parentd891b2bbd16c25995df853121d2f134d3e357cd1
gh-101178: Add Ascii85, Base85, and Z85 support to binascii (GH-102753)

Add Ascii85, Base85, and Z85 encoders and decoders to binascii,
replacing the existing pure Python implementations in base64.

This makes the codecs two orders of magnitude faster and consume
two orders of magnitude less memory.

Note that attempting to decode Ascii85 or Base85 data of length 1 mod 5
(after accounting for Ascii85 quirks) now produces an error, as no
encoder would emit such data. This should be the only significant
externally visible difference compared to the old implementation.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
14 files changed:
Doc/library/base64.rst
Doc/library/binascii.rst
Doc/whatsnew/3.15.rst
Include/internal/pycore_global_objects_fini_generated.h
Include/internal/pycore_global_strings.h
Include/internal/pycore_runtime_init_generated.h
Include/internal/pycore_unicodeobject_generated.h
Lib/base64.py
Lib/test/test_base64.py
Lib/test/test_binascii.py
Misc/ACKS
Misc/NEWS.d/next/Library/2025-12-28-15-55-53.gh-issue-101178.26jYPs.rst [new file with mode: 0644]
Modules/binascii.c
Modules/clinic/binascii.c.h