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

fix(blob): extract padding chars from hashes #240

Closed
wants to merge 2 commits into from
Closed

fix(blob): extract padding chars from hashes #240

wants to merge 2 commits into from

Conversation

william-silversmith
Copy link
Contributor

@william-silversmith william-silversmith commented Aug 12, 2020

I didn't previously understand that the "==" at the end of the hash
isn't merely a delimiter, but a padding character for base64 encoding.
It's not strictly necessary to have it, but you have to add it back in
to perform a base64 decode. Base64 encoded strings are padded out to
a multiple of four characters.

https://en.wikipedia.org/wiki/Base64#Output_padding

I didn't previously understand that the "==" at the end of the hash
isn't merely a delimiter, but a padding character for base64 encoding.
It's not strictly necessary to have it, but you have to add it back in
to perform a base64 decode. Base64 encoded strings are padded out to
a multiple of four characters.
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 12, 2020
@william-silversmith
Copy link
Contributor Author

Looks like #238 and #237 are related.

@tseaver
Copy link
Contributor

tseaver commented Aug 13, 2020

Thanks for the fix! Closing because #238 is already reviewed, and adds a system test.

@tseaver tseaver closed this Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants