Skip to content

Whitespace-tolerant decode #20

Open

Description

@dipu-bd

Real-world Base64 (PEM, MIME, HTTP headers) carries \n and spaces, which the current decoders reject. Add an opt-in flag to skip whitespace during decode.

Architecture fit

  • Opt-in ignoreWhitespace (a.k.a. relaxed) flag on the alphabet decoders, default false so shipped behavior is unchanged (contract invariant).
  • Minimal scope: at least Base64/Base32/Base16; document which characters are treated as whitespace.

Effort: S–M

Checklist

  • ignoreWhitespace flag on AlphabetDecoder (default false)
  • Default (strict) output byte-identical to today — differential proof
  • Tests: whitespace-laced PEM/MIME inputs decode correctly when opted in; still throw when not
  • README / CHANGELOG / example updated
  • Format / analyze / test (vm + node) green

Activity

  1. added
    enhancement
    on Jul 22, 2026
  2. added a commit that references this issue on Jul 22, 2026
    aa0538b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions