[ 
https://issues.apache.org/jira/browse/CODEC-325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17914708#comment-17914708
 ] 

Julian Reschke edited comment on CODEC-325 at 1/20/25 2:57 PM:
---------------------------------------------------------------

I could use "setEncodeTable()", but then my code needs to specify the actual 
table.

So yes, the ability to get the hex table would work as well. I would just avoid 
the term "clone" in the message signature, as how it's generated is of no 
concern for the caller.

That said, to keep things simple, I would *prefer* just a boolean switch (that 
would choose the encode table internally, just like the old constructor). After 
all, [https://datatracker.ietf.org/doc/html/rfc4648] specifies exactly two 
encodings for Base32, so the ability to specify the whole table really sounds 
like an edge case to me (but maybe I'm missing something here...).


was (Author: reschke):
I could use "setEncodingTable()", but then my code needs to specify the actual 
table.

So yes, the ability to get the hex table would work as well. I would just avoid 
the term "clone" in the message signature, as how it's generated is of no 
concern for the caller.

> Base32 builder: make it easier to use the hex encoding table
> ------------------------------------------------------------
>
>                 Key: CODEC-325
>                 URL: https://issues.apache.org/jira/browse/CODEC-325
>             Project: Commons Codec
>          Issue Type: Wish
>            Reporter: Julian Reschke
>            Priority: Minor
>
> In our (Jackrabbit) quest to remove Guava dependencies, we started using the 
> commons-codec Base32 class.
> I first started with the Builder, but noted that using hexEncoding is a bit 
> ... complicated. Other than with the constructor:
>   
> https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Base32.html#%3Cinit%3E(boolean)
> we need to specify the actual encoding table (a nice feature to have), but 
> use one of the two known tables requires actually copying the table over.
> It would be nice if there either was a shortcut (using a boolean as before), 
> or if the two "known" tables could be made visible to the caller (either 
> using public constants, or some convenience methods).
> Best regards, Julian



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to