You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ciphers/base58.py is a copy of base64_cipher.py — no Base58 implementation exists in the file #15637
n/a — no dependencies needed; verified by reading the file on master and diffing against ciphers/base64_cipher.py
Expected behavior
ciphers/base58.py should implement Base58 encoding/decoding — the Bitcoin-style alphabet 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz (no 0, O, I, l), used for e.g. addresses and WIF keys.
base58_encode(b"\x00\x01") should produce "112" (leading zero bytes become leading 1s), and base58_decode("2z") should produce b"\x00\x01".
Actual behavior
ciphers/base58.py contains no Base58 code at all. It is a byte-identical copy of ciphers/base64_cipher.py:
$ diff base58.py base64_cipher.py
(no output — files are identical)
Both files start with
B64_CHARSET="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"# the base64 alphabet
and define the same base64_encode() / base64_decode() functions, with the same doctests comparing against base64.b64encode. A Base58 implementation landed as PR #12123 ("Added Base58 encoding/decoding in ciphers", merged 2026-09-20), but what was merged is the base64 module again, so the repository now has two identical copies of base64 and zero base58.
The fix is to either replace base58.py with a real Base58 implementation (big-int divmod encode/decode with leading-1-per-leading-zero-byte handling and the 58-char alphabet), or delete the file if Base58 is out of scope — keeping a duplicate base64 module under a base58 name just misleads users.
Activity