-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] b64decode does not handle whitespaces #3446
Comments
Note that I did not report it as a bug because the documentation does not seem to imply that white space is handled. A relevant specification is WHATWG Forgiving Base64 decoding: https://infra.spec.whatwg.org/#forgiving-base64-decode C#/.NET follows it, as well as the JavaScript's |
Forgot to add the specs and what Python does which is what we try to follow RFC 4648 is what python follows. Section 3.3
Python: from base64 import b64decode
print(b64decode("Qm9 uam91cg==")) output:
in the Python docs:
|
@martinvuyk Right. So the base64 algorithm in simdutf can solve this at high speed. It is already used in production. (It is part of WebKit/Safari and Node.js, Bun, etc.) |
Bug description
Detected by @lemire in PR #3443
output:
Steps to reproduce
System information
The text was updated successfully, but these errors were encountered: