ciphers/base58.py is a copy of base64_cipher.py — no Base58 implementation exists in the file
維護者通常 2 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
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".
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Python
- 星號
- 225k
- 分支
- 51.2k
- 平均合併
- 1 天 13 小時
- 30 天內合併 PR
- 32
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TheAlgorithms/Python 的其他 Issue
-
binomial_distribution overflows at 171 trials even when the result is representable可能已有人在做 @landfvit 於 1 天前認領。 未關閉
難度 1/5 1 小時以內 新手友好度 85/100
TheAlgorithms/Python#15656 · 1 則留言 ·
維護者通常 2 天內回覆
-
continued_fraction uses float division, producing invalid terms for large integers and raising OverflowError可能已有人在做 @trleo 於 1 天前認領。 未關閉
難度 1/5 1 小時以內 新手友好度 88/100
TheAlgorithms/Python#15655 · 2 則留言 ·
維護者通常 2 天內回覆
-
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 crash可能已有人在做 @Nate-br 於 2 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 88/100
TheAlgorithms/Python#15636 · 1 則留言 ·
維護者通常 2 天內回覆
-
ciphers/des_ecb.py: encrypt/decrypt silently corrupts any character above U+00FF (round-trip fails)可能已有人在做 @mohammedanasnakhuda 於 3 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 88/100
TheAlgorithms/Python#15634 ·
維護者通常 2 天內回覆
-
other/password.py: alternative_password_generator ignores the requested length when the required characters exceed it可能已有人在做 @raaj-2222 於 3 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 85/100
TheAlgorithms/Python#15633 · 1 則留言 ·
維護者通常 2 天內回覆
查看 TheAlgorithms/Python 的全部 Issue
相似的 Issue
-
app: scripts status: backlog type: documentation
難度 2/5 1-3 小時 新手友好度 86/100
netbox-community/netbox-scripts#68 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 91/100
marin-community/marin#10765 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 70/100
flathub/com.unity.UnityHub#230 ·
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
namespace operations
難度 1/5 1 小時以內 新手友好度 63/100
EclipseFdn/open-vsx.org#14910 ·
維護者通常 1 天內回覆