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

Remove base64 dependency and exclude newlines #20

Merged
merged 1 commit into from
Apr 4, 2023
Merged

Conversation

R167
Copy link
Collaborator

@R167 R167 commented Apr 4, 2023

By default, Ruby's Base64.encode64 function is implemented following RFC 2045 which adds newlines every 60 characters. This is kinda silly and was superseded in RFC 4648 which instead recommends only adding newlines if the underlying storage (e.g. MIME headers) strictly requires it.

Because the encode64 and decode64 functions are just super lightweight wrappers around the underlying string packing calls, pack the data directly and specify "m0" for encoding which tells the packing to never add newlines.

All of the data is used entirely internally, so this should be safe to bump as a patch version.

@R167 R167 requested a review from bdurand April 4, 2023 02:57
@R167
Copy link
Collaborator Author

R167 commented Apr 4, 2023

The issues with ruby 2.4/2.5 specs failing will be fixed with #21. Going to merge this now.

@R167 R167 merged commit 4508da1 into master Apr 4, 2023
@R167 R167 deleted the no-base64-newlines branch April 4, 2023 03:24
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.

2 participants