hwsecurity / de.cotech.hw.util / Hex / encodeHex /

encodeHex

open fun encodeHex(data: Array< Byte>): Array< Char>

Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.The returned array will be double the length of the passed array, as it takes two characters to represent anygiven byte.

Return

A char[] containing lower-case hexadecimal characters

Parameters

Name Summary
data a byte[] to convert to Hex characters

open fun encodeHex(data: ByteBuffer): Array< Char>

Converts a byte buffer into an array of characters representing the hexadecimal values of each byte in order.The returned array will be double the length of the passed array, as it takes two characters to represent anygiven byte.

Return

A char[] containing lower-case hexadecimal characters

Parameters

Name Summary
data a byte buffer to convert to Hex characters

open fun encodeHex(data: Array< Byte>, toLowerCase: Boolean): Array< Char>

Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.The returned array will be double the length of the passed array, as it takes two characters to represent anygiven byte.

Return

A char[] containing hexadecimal characters in the selected case

Parameters

Name Summary
data a byte[] to convert to Hex characters
toLowerCase true converts to lowercase, false to uppercase

open fun encodeHex(data: ByteBuffer, toLowerCase: Boolean): Array< Char>

Converts a byte buffer into an array of characters representing the hexadecimal values of each byte in order.The returned array will be double the length of the passed array, as it takes two characters to represent anygiven byte.

Return

A char[] containing hexadecimal characters in the selected case

Parameters

Name Summary
data a byte buffer to convert to Hex characters
toLowerCase true converts to lowercase, false to uppercase