ciphers/base58.py is a copy of base64_cipher.py — no Base58 implementation exists in the file
Maintainer antworten meist innerhalb von 2 Tagen
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- developer-experience
Rechercherichtung
Read ciphers/base58.py and diff it against ciphers/base64_cipher.py to confirm it is a duplicate; PR #12123 and its linked follow-up PR #15638 are the history to check. Note that an open pull request (#15638) already targets this fix, so coordinate or pick a different issue. If taking it on, implement the Base58 alphabet with big-int divmod encode/decode, handle leading zero bytes as leading 1s, and update the doctests so base58_encode(b"\x00\x01") == "112".
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Repository commit
master @ 6e03a485 (base58.py last touched by 3e48459b)
Python version (python --version)
Python 3.13.5
Dependencies version (pip freeze)
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.
Concretely, anyone importing the module expecting base58 gets base64 behavior silently:
>>> from ciphers.base58 import base64_encode
>>> base64_encode(b"Hello") # named/behaves as base64, no base58 API exists
b'SGVsbG8='
and searching the repo for the Base58 alphabet finds nothing:
$ grep -rn "123456789ABCDEFGHJKLMNPQRSTUVWXYZ" . # canonical Base58 alphabet
(no matches)
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.
- Vorherrschende Sprache
- Python
- Sterne
- 225k
- Forks
- 51.2k
- Ø Merge
- 1 T. 13 Std.
- Gemergte PRs (30 T.)
- 32
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TheAlgorithms/Python
-
binomial_distribution overflows at 171 trials even when the result is representableEvtl. vergeben @landfvit hat das vor 1 Tag übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
TheAlgorithms/Python#15656 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
continued_fraction uses float division, producing invalid terms for large integers and raising OverflowErrorEvtl. vergeben @trleo hat das vor 1 Tag übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
TheAlgorithms/Python#15655 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
ciphers/base32.py and ciphers/base85.py encode Unicode code points instead of bytes: output diverges from the spec for non-ASCII, round-trips corrupt chars >= U+0400, arbitrary bytes crashEvtl. vergeben @Nate-br hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
TheAlgorithms/Python#15636 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
ciphers/des_ecb.py: encrypt/decrypt silently corrupts any character above U+00FF (round-trip fails)Evtl. vergeben @mohammedanasnakhuda hat das vor 4 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
TheAlgorithms/Python#15634 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
other/password.py: alternative_password_generator ignores the requested length when the required characters exceed itEvtl. vergeben @raaj-2222 hat das vor 4 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
TheAlgorithms/Python#15633 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in TheAlgorithms/Python
Ähnliche Issues
-
priority middle
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
KATO-Hiro/AtCoderClans#12940 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
huggingface/huggingface_hub#5283 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
ccxt/ccxt#31045 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug example
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 1 Tag