-
Notifications
You must be signed in to change notification settings - Fork 139
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 decode doesn't give correct result #38
Comments
I'm not at a computer for the rest of the weekend but base64 encoding/decoding can be performed natively by browsers by using atob and btoa. |
Thanks, I know about |
Yeah, that's a problem. |
It should use i++ here: https://github.com/h2non/jshashes/blob/master/hashes.js#L331~L334 . |
We should update the input length after UTF-8 convert: https://github.com/h2non/jshashes/blob/master/hashes.js#L301. |
Please see this small example: https://jsfiddle.net/j1rp55oo/
You can check that
Base64.encode(...)
works correctly by decoding it's output using OpenSSL or any other base64 encoder.Base64.decode(...)
on the other hand, returns complete garbage.The text was updated successfully, but these errors were encountered: