Base64 Decoder: show precise errors for invalid characters and padding
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- TypeScript
- 星标
- 1
- 派生
- 9
- 平均合并
- 7 小时 48 分钟
- 30 天内合并 PR
- 187
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codercops/toolbelt 的其他 Issue
-
JSON and CSV Formatter: sizes just under 1 MB show as "1024.0 KB"可能已有人在做 @prakashNalla 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
codercops/toolbelt#422 · 1 条评论 ·
维护者通常 1 天内回复
-
Base64: sizes just under 1 MB show as "1024.0 KB"可能已有人在做 @prakashNalla 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
codercops/toolbelt#421 · 1 条评论 ·
维护者通常 1 天内回复
-
Add a Unicode & Invisible Character Inspector tool可能已有人在做 @srikar-naidu 今天认领。 未关闭enhancement
难度 5/5 一周以上 新手友好度 45/100
codercops/toolbelt#420 · 1 条评论 ·
维护者通常 1 天内回复
-
Text Case Converter: show how identifiers are split into words可能已有人在做 @srikar-naidu 于 1 天前认领。 未关闭enhancement hacktoberfest
codercops/toolbelt#409 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Regex Tester: add next/previous match navigation可能已有人在做 @kachamsiddarth 于 1 天前认领。 未关闭enhancement hacktoberfest
codercops/toolbelt#380 · 5 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 codercops/toolbelt 的全部 Issue
相似的 Issue
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 67/100
anthropics/claude-code#106183 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
feature:App-Tour feature:Chat ready Web
难度 2/5 1-3 小时 新手友好度 62/100
digitalfabrik/integreat-app#4523 · 2 个 reaction ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Required Lexical field accepts two empty paragraphs可能已有人在做 @lazerg 今天认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 76/100
payloadcms/payload#19222 ·
维护者通常 1 天内回复