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

decodeHex

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

Converts a String representing hexadecimal values into an array of bytes of those same values. Thereturned array will be half the length of the passed String, as it takes two characters to represent any givenbyte. An exception is thrown if the passed String has an odd number of elements.

Return

A byte array containing binary data decoded from the supplied char array.

Parameters

Name Summary
data A String containing hexadecimal digits

Throws

Name Summary
java.io.IOException Thrown if an odd number or illegal of characters is supplied

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

Converts an array of characters representing hexadecimal values into an array of bytes of those same values. Thereturned array will be half the length of the passed array, as it takes two characters to represent any givenbyte. An exception is thrown if the passed char array has an odd number of elements.

Return

A byte array containing binary data decoded from the supplied char array.

Parameters

Name Summary
data An array of characters containing hexadecimal digits

Throws

Name Summary
java.io.IOException Thrown if an odd number or illegal of characters is supplied