Skip to content

[CODEC-343] Fix Base32 hex decode table builder#435

Merged
garydgregory merged 2 commits into
apache:masterfrom
OldTruckDriver:fix/CODEC-343_base32_hex_decode_table
Jun 18, 2026
Merged

[CODEC-343] Fix Base32 hex decode table builder#435
garydgregory merged 2 commits into
apache:masterfrom
OldTruckDriver:fix/CODEC-343_base32_hex_decode_table

Conversation

@OldTruckDriver

Copy link
Copy Markdown
Contributor

Summary

Fix Base32.Builder#setHexDecodeTable(boolean) so it configures the matching Base32/Base32-Hex encode table instead of passing a decode lookup table to setEncodeTable(byte...).

Details

The previous implementation passed decodeTable(useHex) into setEncodeTable(...). Used on its own, this made the codec encode with a decode lookup table and emit invalid bytes.

This change updates setHexDecodeTable(boolean) to use encodeTable(useHex) and adds a regression test proving the configured codec encodes with the Base32-Hex alphabet and decodes its own output.

Tests

  • mvn -q -Dtest=org.apache.commons.codec.binary.Base32Test test
  • mvn -q javadoc:javadoc
  • mvn -q

OldTruckDriver and others added 2 commits June 17, 2026 22:41
Configure setHexDecodeTable(boolean) with the matching encode table instead of passing a decode lookup table to setEncodeTable(byte...).

Add a regression test showing the configured codec encodes with the Base32-Hex alphabet and decodes its own output.

Reviewed-by: OpenAI Codex
Reviewed-by: Anthropic Claude Code
@garydgregory garydgregory merged commit 7591504 into apache:master Jun 18, 2026
9 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.

2 participants