OldTruckDriver opened a new pull request, #434: URL: https://github.com/apache/commons-codec/pull/434
JIRA: https://issues.apache.org/jira/browse/CODEC-341 ### Problem `Base16.Builder#setEncodeTable(...)` honors a custom alphabet for encoding, but only ever pairs it with the built-in upper/lower decode table. A `Base16` built with any other alphabet, therefore, cannot decode its own output. ### Fix Derive the decode table from the configured encode table (`toDecodeTable`), so a custom alphabet round-trips. Encode tables that are not 16 unique bytes are rejected with `IllegalArgumentException`. ### Notes (behavior changes) - `setEncodeTable(...)` now throws `IllegalArgumentException` for tables that are not 16 unique bytes (previously accepted, producing undecodable output). - `Builder#setLowerCase(true)` now also sets the matching decode table; before, `builder().setLowerCase(true)` could not decode its own lower-case `a–f` output. ### Tests Added to `Base16Test`: custom-alphabet round-trip, rejection of duplicate and wrong-length tables, and a `builder().setLowerCase(true)` round-trip that fails without this change. ### Verification `mvn` passes locally (tests, Checkstyle, PMD, Javadoc). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
