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

encodeHexString

open fun encodeHexString(data: Array< Byte>): String

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

Return

A String containing lower-case hexadecimal characters

Parameters

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

open fun encodeHexString(data: Array< Byte>, toLowerCase: Boolean): String

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

Return

A String containing lower-case hexadecimal characters

Parameters

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

open fun encodeHexString(data: ByteBuffer): String

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

Return

A String containing lower-case hexadecimal characters

Parameters

Name Summary
data a byte buffer to convert to Hex characters

open fun encodeHexString(data: ByteBuffer, toLowerCase: Boolean): String

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

Return

A String containing lower-case hexadecimal characters

Parameters

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