Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove less common alphabets.
  • Loading branch information
serhiy-storchaka committed Mar 17, 2026
commit 133505dcf74f398e4c9b2b0e1a7c3e25708b9821
16 changes: 2 additions & 14 deletions Doc/library/binascii.rst
Original file line number Diff line number Diff line change
Expand Up @@ -291,27 +291,15 @@ The :mod:`!binascii` module defines the following functions:

.. versionadded:: next

.. data:: CRYPT_ALPHABET

The Base 64 alphabet used in the :manpage:`crypt(3)` routine and in the GEDCOM format.

.. versionadded:: next

.. data:: BCRYPT_ALPHABET

The Base 64 alphabet used in the ``bcrypt`` hashing function.

.. versionadded:: next

.. data:: UU_ALPHABET

The uuencoding alphabet.

.. versionadded:: next

.. data:: XX_ALPHABET
.. data:: CRYPT_ALPHABET

The xxencoding alphabet.
The Base 64 alphabet used in the :manpage:`crypt(3)` routine and in the GEDCOM format.

.. versionadded:: next

Expand Down
11 changes: 1 addition & 10 deletions Lib/test/test_binascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,11 @@ def test_constants(self):
b'0123456789+/')
self.assertEqual(binascii.URLSAFE_BASE64_ALPHABET,
binascii.BASE64_ALPHABET[:-2] + b'-_')
self.assertEqual(binascii.UU_ALPHABET, bytes(range(32, 32+64)))
self.assertEqual(binascii.CRYPT_ALPHABET,
b'./0123456789'
b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
b'abcdefghijklmnopqrstuvwxyz')
self.assertEqual(binascii.BCRYPT_ALPHABET,
b'./'
b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
b'abcdefghijklmnopqrstuvwxyz'
b'0123456789')
self.assertEqual(binascii.UU_ALPHABET, bytes(range(32, 32+64)))
self.assertEqual(binascii.XX_ALPHABET,
b'+-0123456789'
b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
b'abcdefghijklmnopqrstuvwxyz')
self.assertEqual(binascii.BINHEX_ALPHABET,
b'!"#$%&\'()*+,-012345689'
b'@ABCDEFGHIJKLMNPQRSTUVXYZ['
Expand Down
15 changes: 0 additions & 15 deletions Modules/binascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -2082,14 +2082,6 @@ binascii_exec(PyObject *module)
{
return -1;
}
if (PyModule_Add(module, "BCRYPT_ALPHABET",
PyBytes_FromString("./"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789")) < 0)
{
return -1;
}
if (PyModule_Add(module, "UU_ALPHABET",
PyBytes_FromString(" !\"#$%&'()*+,-./"
"0123456789:;<=>?@"
Expand All @@ -2098,13 +2090,6 @@ binascii_exec(PyObject *module)
{
return -1;
}
if (PyModule_Add(module, "XX_ALPHABET",
PyBytes_FromString("+-0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz")) < 0)
{
return -1;
}
if (PyModule_Add(module, "BINHEX_ALPHABET",
PyBytes_FromString("!\"#$%&'()*+,-012345689@"
"ABCDEFGHIJKLMNPQRSTUVXYZ[`"
Expand Down
Loading