Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Base64 Decoder: show precise errors for invalid characters and padding

Aperta
#406 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@srikar-naidu ci sta già lavorando.

Dal 28/10/2026.

  • #417 di @srikar-naidu — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.
Lingua principale
TypeScript
Stelle
1
Fork
9
Merge medio
7h 46m
PR unite (30g)
186

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codercops/toolbelt

Tutte le issue di codercops/toolbelt

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.