[codec] Hex encode

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[codec] Hex encode

Or Mark
Hello,

About commons-codec Hex encoding methods,
I suggest adding to Hex static encode method which returns byte[]
It will be consistent with other encoding classes that have such method as
Base64(same package) and MessageDigest.

I don't see a real reason to use instance method in this case.

I would like to contribute this method to library.

First asked in
https://stackoverflow.com/questions/58128819/apache-common-codec-why-hex-encode-isnt-static/58129148#58129148
Reply | Threaded
Open this post in threaded view
|

Re: [codec] Hex encode

sebb-2-2
On Sat, 28 Sep 2019 at 06:21, Or Mark <[hidden email]> wrote:
>
> Hello,
>
> About commons-codec Hex encoding methods,
> I suggest adding to Hex static encode method which returns byte[]
> It will be consistent with other encoding classes that have such method as
> Base64(same package) and MessageDigest.

Base64 has a static method, but this actually calls a method on a
cached instance using UTF-8.
The use of UTF-8 is noted in the Javadoc.

> I don't see a real reason to use instance method in this case.

It uses the instance Charset, as noted in the Javadoc.

> I would like to contribute this method to library.

What is the use case for this?

> First asked in
> https://stackoverflow.com/questions/58128819/apache-common-codec-why-hex-encode-isnt-static/58129148#58129148

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]