Correct encoding examples, padding lengths and decoder alphabet documentation - #68
Open
OskarEichler wants to merge 1 commit into
Open
Correct encoding examples, padding lengths and decoder alphabet documentation#68OskarEichler wants to merge 1 commit into
OskarEichler wants to merge 1 commit into
Conversation
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.
Summary
Correct the Base64 documentation's encoded values, newline lengths, padding explanations, and accepted alphabets. Regenerate the corresponding RBS documentation with the existing
rbs:annotatetask. No runtime implementation or type signatures change.Reproduction
Current documentation says
Base64.strict_encode64('123')returns"MDEy", but it returns"MTIz". The same shifted input affects twelve examples.Base64.encode64("\x00").sizeis 5, not 4, because the newline counts toward the length.The unpadded-output sections incorrectly describe trailing padding, and the decoder overview incorrectly says every decoder accepts missing padding.
/belongs to the standard alphabet. URL-safe decoding also accepts the standard alphabet (and mixed alphabets), so testing a single+or/demonstrates an invalid length rather than an alphabet restriction.Verification
Using Ruby 4.0.6 through rbenv:
rake test: 9 tests, 73 assertions, no failures/errors.rake rbs:test: 6 tests, 35 assertions, no failures/errors.rake rbs:annotate, Ruby syntax check, gem build, andgit diff --checkpass. Gem build retains the existing metadata warnings.No tests were added or modified, per the requesting project's contribution constraint. Verification was local on macOS/Ruby 4.0.6; the full supported Ruby/OS matrix was not run locally. Existing documentation fixes already on main, including #46's signature comments, are not duplicated.
Breaking changes
None. This changes documentation only; accepted input, output, signatures, dependencies, and version are unchanged.