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

Enable decoding of unpadded base64 strings #187

Merged
merged 1 commit into from
Mar 26, 2022

Conversation

Regenhardt
Copy link
Contributor

Closes #178

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • [x ] Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Internationalization and localization
  • Other (please describe):

What is the current behaviour?

Pasting a base64 string without the final '=' can not be decoded.

Issue Number: #178

What is the new behaviour?

Pasting a base64 string without final '=' will add the final '=' to the data to be decoded. Input data in the form is not modified.

Other information

Quality check

Before creating this PR, have you:

  • [x ] Followed the code style guideline as described in CONTRIBUTING.md
  • Verified that the change work in Release build configuration // Storage full, currently can't build
  • [x ] Checked all unit tests pass

@Regenhardt
Copy link
Contributor Author

Turns out installing VS2022 side-by-side and a few new modules filled up my storage real good. Will check that box when I cleaned up.

@Regenhardt Regenhardt force-pushed the feature/loose-base64-decoding branch from f15dae9 to 4612bfe Compare March 21, 2022 19:02
veler
veler previously approved these changes Mar 22, 2022
@veler
Copy link
Collaborator

veler commented Mar 22, 2022

Actually, it seems like some unit tests don't pass anymore, according to the CI? 🤔

@veler veler self-requested a review March 22, 2022 04:26
@veler veler dismissed their stale review March 22, 2022 04:27

unit tests are failing

@Regenhardt Regenhardt force-pushed the feature/loose-base64-decoding branch from 4612bfe to 4ea7ad5 Compare March 22, 2022 08:30
@Regenhardt
Copy link
Contributor Author

Oh damn, I'm glad I wrote that test lol.
So let's make sure I got it right this time:
if I'm 3 over, length%4 is 3, and I want one padding to land on the 4 exactly, so padding has to be 4-3=1. Seems to fit my code.

@Regenhardt
Copy link
Contributor Author

So it works fine locally, and also the failed test has nothing to do with this feature or my changes. Not sure how to fix that.

@Regenhardt Regenhardt force-pushed the feature/loose-base64-decoding branch from 4ea7ad5 to cf604c0 Compare March 23, 2022 18:42
@Regenhardt
Copy link
Contributor Author

Rebased onto main, let's see what happens I guess.

@Regenhardt
Copy link
Contributor Author

Yup rebase worked, this one's ready now.

@veler
Copy link
Collaborator

veler commented Mar 26, 2022

Hello,
Sorry for the late answer.
All the tests pass now :) Thank you very much for this contribution! :D

@veler veler merged commit 93761a4 into DevToys-app:main Mar 26, 2022
veler pushed a commit that referenced this pull request Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loosen requirements for base64 decoding
4 participants