Base64 Decoder: show precise errors for invalid characters and padding
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 9
- Merge medio
- 7h 46m
- PR unite (30g)
- 186
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codercops/toolbelt
-
Text Case Converter: show how identifiers are split into wordsForse già presa @srikar-naidu l’ha presa oggi. Apertaenhancement hacktoberfest
codercops/toolbelt#409 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Regex Tester: add next/previous match navigationForse già presa @kachamsiddarth l’ha presa oggi. Apertaenhancement hacktoberfest
codercops/toolbelt#380 · 5 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
hacktoberfest
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 1/100
codercops/toolbelt#101 · 17 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[admin] Quarterly content-refresh routineForse di nuovo libera @anurag629 l’ha presa 110 giorni fa e non c’è nessuna pull request aperta. Apertaadmin-only seo
codercops/toolbelt#47 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[admin] Repurpose guides to dev communities and socialForse di nuovo libera @anurag629 l’ha presa 110 giorni fa e non c’è nessuna pull request aperta. Apertaadmin-only seo
codercops/toolbelt#44 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di codercops/toolbelt
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gnosis/gnosis_vpn#661 ·
I maintainer di solito rispondono entro 1 giorno
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Apertatriage:bug-verified
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
fix: reject sourceStorage/packagedStorage bucket that differs from the stack default (fail loud)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Eyevinn/open-videocore#1300 ·
I maintainer di solito rispondono entro 1 giorno
-
nextjs-tracking
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
cloudflare/vinext#4390 ·
I maintainer di solito rispondono entro 1 giorno
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
kubernetes-sigs/headlamp#8175 ·
I maintainer di solito rispondono entro 2 giorni