Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Base64 Decoder: show precise errors for invalid characters and padding

Abierto
#406 2 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@srikar-naidu ya está trabajando en esto.

Desde el 28/10/2026.

  • #417 de @srikar-naidu — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.
Lenguaje dominante
TypeScript
Estrellas
1
Forks
9
Merge medio
7 h 46 min
PR fusionados (30 d)
186

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de codercops/toolbelt

Todos los issues de codercops/toolbelt

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.