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

Base64 Decoder: show precise errors for invalid characters and padding

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

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

@srikar-naidu đang làm issue này rồi.

Từ ngày 28/10/2026.

  • #417 của @srikar-naidu — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

enhancement hacktoberfest
What problem does this solve?

When Base64 decoding fails, a generic error makes it difficult to find the problem in a long input.

Identifying the invalid character or padding position would help users fix malformed tokens, copied payloads, and encoded file contents more quickly.

Proposed solution

Improve Base64 validation and decoding errors with specific explanations and input positions.

Scope
  • Identify invalid characters and their positions in the original input.
  • Detect padding placed before the end of the encoded content.
  • Detect excessive padding and invalid encoded lengths.
  • Detect inputs mixing standard Base64 characters (+, /) with URL-safe characters (-, _).
  • Explain which alphabet is accepted by the selected decoding mode.
  • Preserve the tool’s existing handling of whitespace, missing padding, and data-URI prefixes where supported.
  • Keep valid Base64 that decodes to binary distinguishable from a decoding failure.
  • Do not silently remove invalid characters or rewrite the input.
Acceptance criteria
  • Invalid characters produce an actionable message with a 1-based position.
  • Positions refer to the original input, including when whitespace or a supported data-URI prefix is present.
  • Misplaced padding, excessive padding, and impossible lengths have distinct messages.
  • Mixed alphabets produce a clear explanation consistent with the selected mode.
  • Valid standard and URL-safe inputs continue to decode correctly.
  • Existing supported unpadded inputs remain supported.
  • Valid binary output is not reported as malformed Base64 merely because it is not UTF-8 text.
  • Failed decoding clears stale output.
  • Error messages are accessible and readable in both site themes.
  • Validation logic lives in lib/ with tests for each error category and existing accepted input formats.
  • All validation and decoding happen locally in the browser.
  • npm run lint && npm run test && npm run build pass.

Automatic input repair, new encoding formats, and changes to file-size limits are outside this issue’s scope.

Fit
  • This can work entirely in the browser with no server or data leaving the tab.
Ngôn ngữ chính
TypeScript
Star
1
Fork
9
Merge trung bình
7 giờ 46 phút
Pull request đã merge (30 ngày)
186

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

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 codercops/toolbelt

Tất cả issue của codercops/toolbelt

Issue tương tự

Thêm issue về TypeScript

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.