Don't double-encode in urlsafe_base64#13
Open
cheerfulstoic wants to merge 1 commit intopatricksrobertson:masterfrom
Open
Don't double-encode in urlsafe_base64#13cheerfulstoic wants to merge 1 commit intopatricksrobertson:masterfrom
cheerfulstoic wants to merge 1 commit intopatricksrobertson:masterfrom
Conversation
I tried using this function and the results were longer than they should have been. This was because it was encoding to standard base64 and then re-encoding *that* to URL-safe base64. This change fixes that
halostatue
added a commit
to KineticCafe/secure_random
that referenced
this pull request
Jul 15, 2024
The test assumes 22 byte default, but had 32 because it was double-base64 encoding (once regular, and once URL-safe). Without the double encoding, the tests fail because they were expecting 32 (then 24), but the intent was URL-safe base encoding without padding. Originally based on patricksrobertson#13, but fixes the tests and padding.
halostatue
added a commit
to KineticCafe/secure_random
that referenced
this pull request
Jul 16, 2024
The test assumes 22 byte default, but had 32 because it was double-base64 encoding (once regular, and once URL-safe). Without the double encoding, the tests fail because they were expecting 32 (then 24), but the intent was URL-safe base encoding without padding. Originally based on patricksrobertson#13, but fixes the tests and padding.
|
Moved description of the severity of the issue addressed by this PR to issue #16 |
This was referenced Sep 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried using this function and the results were longer than they should have been. This was because it was encoding to standard base64 and then re-encoding that to URL-safe base64. This change fixes that