You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 29, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 29, 2026. It is now read-only.
The decoder rejects padded input, though the docs say it accepts it #39
README.md, the package readme and the XML documentation of NCode.Encoders.Base64Url say the decoder accepts both padded and unpadded input ("decoder accepts both padded and unpadded input"; "all decoding methods accept both padded and unpadded input"). It doesn't: = maps to -1 in DecodingMap (NCode.Base64Url/Base64Url.cs), so a padded string throws.
Reproduced against the current build:
Base64Url.Decode("SGVsbG8") returns 5 bytes.
Base64Url.Decode("SGVsbG8=") throws FormatException ("contains an illegal character").
No test covers padded input.
Needs a maintainer's decision: either accept trailing = padding (strip up to two = before decoding, in every Decode/TryDecode overload, sequences included, and in GetByteCountForDecode's length check), which is what the docs promise, or correct the docs to say padding is rejected. Either way, add tests for padded input.
Found while updating to project-template v0.145.1 (#29, #38).
Autopilot: closed as not planned. NCode.Base64Url is retired (#43). The READMEs now say the decoder rejects = padding and whitespace, as it does, and no release will ship an XML-documentation fix.
Activity
polewskm commentedon Nov 29, 2026
Autopilot: closed as not planned. NCode.Base64Url is retired (#43). The READMEs now say the decoder rejects
=padding and whitespace, as it does, and no release will ship an XML-documentation fix.