Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

ciphers/base58.py is a copy of base64_cipher.py — no Base58 implementation exists in the file

Đang mở
#15,637 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@SakshiYeole đang làm issue này rồi.

Từ ngày 25/10/2026.

  • #15638 của @SakshiYeole — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
developer-experience

Hướng nghiên cứu

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".

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
225k
Fork
51.2k
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
32

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TheAlgorithms/Python

Tất cả issue của TheAlgorithms/Python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.