Base64 Decoder: show precise errors for invalid characters and padding
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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 buildpass.
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
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codercops/toolbelt
-
Text Case Converter: show how identifiers are split into wordsCó thể đã có người làm @srikar-naidu đã nhận hôm nay. Đang mởenhancement hacktoberfest
codercops/toolbelt#409 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Regex Tester: add next/previous match navigationCó thể đã có người làm @kachamsiddarth đã nhận hôm nay. Đang mởenhancement hacktoberfest
codercops/toolbelt#380 · 5 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Hacktoberfest 2026: start hereĐang mởhacktoberfest
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 1/100
codercops/toolbelt#101 · 17 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[admin] Quarterly content-refresh routineCó thể làm lại được @anurag629 đã nhận 110 ngày trước và không có pull request nào đang mở. Đang mởadmin-only seo
codercops/toolbelt#47 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[admin] Repurpose guides to dev communities and socialCó thể làm lại được @anurag629 đã nhận 110 ngày trước và không có pull request nào đang mở. Đang mởadmin-only seo
codercops/toolbelt#44 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của codercops/toolbelt
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
gnosis/gnosis_vpn#661 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Đang mởtriage:bug-verified
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
fix: reject sourceStorage/packagedStorage bucket that differs from the stack default (fail loud)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Eyevinn/open-videocore#1300 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
nextjs-tracking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
cloudflare/vinext#4390 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kubernetes-sigs/headlamp#8175 ·
Maintainer thường phản hồi trong vòng 2 ngày