Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@karanabe
Copy link
Contributor

@karanabe karanabe commented Nov 9, 2025

This updates basenc’s base32/base32hex decoder to auto-pad trailing quanta, stream output safely, and reject garbage the same way GNU does. Existing by-util basenc/base32 tests already cover these scenarios.
Removed the old note about data-encoding’s ignore flag because the new alphabet gatekeeper makes that rationale obsolete.

#9127

@sylvestre
Copy link
Contributor

Could you please add tests to make sure we don't regress in the future?

@github-actions
Copy link

github-actions bot commented Nov 9, 2025

GNU testsuite comparison:

Congrats! The gnu test tests/basenc/basenc is no longer failing!

@karanabe
Copy link
Contributor Author

karanabe commented Nov 9, 2025

Added the tests. Thanks for the feedback!

@github-actions
Copy link

github-actions bot commented Nov 9, 2025

GNU testsuite comparison:

Congrats! The gnu test tests/basenc/basenc is no longer failing!

Adds the GNU-style auto-padding/truncated cases to
tests/by-util/test_basenc.rs and rewrites the failure assertions to use
the chained fails().stdout_*(…).stderr_is(…) style for clarity.
Updates util/build-gnu.sh to stop forcing those two basenc tests to
expect empty stdout, so the GNU suite again checks for the leaked five
bytes before failure.
Introduce PadResult, trim/pad incomplete base32 chunks, emit decoded
prefixes, and still return error: invalid input in line with GNU basenc.
@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/basenc/basenc is no longer failing!

@sylvestre sylvestre merged commit 364d9e9 into uutils:main Nov 10, 2025
124 checks passed
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.

3 participants