Skip to content
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

[base64] Accept whitespaces #55

Open
dtinth opened this issue Aug 17, 2022 · 1 comment
Open

[base64] Accept whitespaces #55

dtinth opened this issue Aug 17, 2022 · 1 comment

Comments

@dtinth
Copy link

dtinth commented Aug 17, 2022

Most base-64 decoding libraries accept (and ignore) whitespaces, however this library throws an error.

It would be much more convenient if this library is more lenient in reading base64 data by skipping whitespace characters.

@dchest
Copy link
Member

dchest commented Aug 17, 2022

I'm a strong believer in strict encoding/decoding. If the intention is to decode data with whitespaces, it should be explicitly handled by the user by removing them. Especially since this library attempts to be constant-time, unlike others. So I will not enable this by default.

However, there could be a specific decoder, similar to URLSafeCoder, which will skip whitespaces on decoding, and even maybe format on encoding (like openssl base64).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants