You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Derive Base32 decode tables from custom encode tables so a configured codec can decode its own output.
Reject encode tables that do not contain exactly 32 unique byte values.
Reviewed-by: OpenAI Codex
Reviewed-by: Anthropic Claude Code
Copy file name to clipboardExpand all lines: src/changes/changes.xml
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,7 @@ The <action> type attribute can be add,update,fix,remove.
45
45
<body>
46
46
<releaseversion="1.22.1"date="YYYY-MM-DD"description="This is a feature and maintenance release. Java 8 or later is required.">
47
47
<!-- FIX -->
48
+
<actiontype="fix"issue="CODEC-342"dev="ggregory"due-to="Ruiqi Dong, Gary Gregory">Base32.Builder.setEncodeTable(byte...) can create a codec that cannot decode its own output.</action>
48
49
<actiontype="fix"issue="CODEC-343"dev="ggregory"due-to="Ruiqi Dong, Gary Gregory">Base32.Builder.setHexDecodeTable(boolean) sets the encode table to a decode lookup table.</action>
49
50
<actiontype="add"issue="CODEC-337"dev="pkarwasz"due-to="Ruiqi Dong, Gary Gregory">Digest ALL reuses System.in, so only the first algorithm sees the real input (#431).</action>
* This array is a lookup table that translates Unicode characters drawn from the "Base32 Alphabet" (as specified in Table 3 of RFC 4648) into their 5-bit
@@ -256,6 +268,29 @@ public static Builder builder() {
256
268
returnnewBuilder();
257
269
}
258
270
271
+
/**
272
+
* Calculates a decode table for a given encode table.
273
+
*
274
+
* @param encodeTable that is used to determine decode lookup table.
275
+
* @return A new decode table.
276
+
* @throws IllegalArgumentException if the encode table does not contain exactly 32 unique entries.
0 commit comments