ciphers/base58.py is a copy of base64_cipher.py — no Base58 implementation exists in the file
Les mainteneurs répondent en général sous 2 jours
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 45/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- python
- Domaine
- developer-experience
Piste de recherche
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".
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 225k
- Forks
- 51.2k
- Merge moyen
- 1 j 13 h
- PR mergées (30 j)
- 32
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de TheAlgorithms/Python
-
binomial_distribution overflows at 171 trials even when the result is representablePeut-être pris @landfvit l’a pris il y a 1 jour. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
TheAlgorithms/Python#15656 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
continued_fraction uses float division, producing invalid terms for large integers and raising OverflowErrorPeut-être pris @trleo l’a pris il y a 1 jour. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
TheAlgorithms/Python#15655 · 2 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
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 crashPeut-être pris @Nate-br l’a pris il y a 3 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
TheAlgorithms/Python#15636 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
ciphers/des_ecb.py: encrypt/decrypt silently corrupts any character above U+00FF (round-trip fails)Peut-être pris @mohammedanasnakhuda l’a pris il y a 4 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
TheAlgorithms/Python#15634 ·
Les mainteneurs répondent en général sous 2 jours
-
other/password.py: alternative_password_generator ignores the requested length when the required characters exceed itPeut-être pris @raaj-2222 l’a pris il y a 4 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
TheAlgorithms/Python#15633 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de TheAlgorithms/Python
Issues similaires
-
enhancement help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Git-Hospital/githealthcheck#61 ·
Les mainteneurs répondent en général sous 1 jour
-
changelog investigate
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
ramnes/notion-sdk-py#433 ·
-
Partial method descriptors raise on class accessPeut-être pris @Gambit-Checkmate l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 19 jours
-
docs pkg:core
Difficulté 1/5 Moins d'une heure Accessibilité débutants 84/100
pydantic/pydantic-ai#11929 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
intake/intake-esm#789 ·