commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Spero (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CODEC-224) Add convenience API org.apache.commons.codec.binary.Hex.encodeHexString(byte[]|ByteBuffer, boolean)
Date Tue, 04 Jul 2017 18:32:00 GMT

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

Simon Spero commented on CODEC-224:
-----------------------------------

This commit also added lower/upper case configuration for encodeHexString, which I was about
to add because I needed it for coveralls. 

> Add convenience API org.apache.commons.codec.binary.Hex.encodeHexString(byte[]|ByteBuffer,
boolean)
> ---------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-224
>                 URL: https://issues.apache.org/jira/browse/CODEC-224
>             Project: Commons Codec
>          Issue Type: Improvement
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>             Fix For: 1.11
>
>
> Add convenience APIs:
> {{org.apache.commons.codec.binary.Hex.encodeHexString(byte[], boolean)}}:
> {code:java}
>     /**
>      * Converts an array of bytes into a String representing the hexadecimal values of
each byte in order. The returned
>      * String will be double the length of the passed array, as it takes two characters
to represent any given byte.
>      *
>      * @param data
>      *            a byte[] to convert to Hex characters
>      * @param toLowerCase
>      *            <code>true</code> converts to lowercase, <code>false</code>
to uppercase
>      * @return A String containing lower-case hexadecimal characters
>      * @since 1.11
>      */
>     public static String encodeHexString(final byte[] data, boolean toLowerCase)
> {code}
> {{org.apache.commons.codec.binary.Hex.encodeHexString(ByteBuffer, boolean)}}:
> {code:java}
>     /**
>      * Converts a byte buffer into a String representing the hexadecimal values of each
byte in order. The returned
>      * String will be double the length of the passed array, as it takes two characters
to represent any given byte.
>      *
>      * @param data
>      *            a byte buffer to convert to Hex characters
>      * @param toLowerCase
>      *            <code>true</code> converts to lowercase, <code>false</code>
to uppercase
>      * @return A String containing lower-case hexadecimal characters
>      * @since 1.11
>      */
>     public static String encodeHexString(final ByteBuffer data, boolean toLowerCase)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message