Skip to content

Whitespace-tolerant decode #20

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions