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

Hex

open class Hex

Converts hexadecimal Strings. This class is thread-safe.

Functions

Name Summary
decodeHex

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.

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

Converts a String representing hexadecimal values into an array of bytes of those same values.

decodeHexOrFail open fun decodeHexOrFail(data: String): Array<Byte>
encodeHex

open fun encodeHex(data: Array<Byte>): Array<Char>
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.

open fun encodeHex(data: ByteBuffer): Array<Char>
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.

encodeHexString

open fun encodeHexString(data: Array<Byte>): String
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.

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

Converts a byte buffer into a String representing the hexadecimal values of each byte in order.