![]() |
Keyple Util C++ Library 2.3.0.5-SNAPSHOT
Reference Terminal Reader API for C++
|
#include <HexUtil.h>
Static Public Member Functions | |
static bool | isValid (const std::string &hex) |
static const std::vector< uint8_t > | toByteArray (const std::string &hex) |
static uint8_t | toByte (const std::string &hex) |
static uint16_t | toShort (const std::string &hex) |
static uint32_t | toInt (const std::string &hex) |
static uint64_t | toLong (const std::string &hex) |
static const std::string | toHex (const std::vector< uint8_t > &tab) |
static const std::string | toHex (const uint8_t val) |
static const std::string | toHex (const uint16_t val) |
static const std::string | toHex (const uint32_t val) |
static const std::string | toHex (const uint64_t val) |
|
static |
Checks if a string is formed by an even number of hexadecimal digits.
hex | The string to check. |
Definition at line 66 of file HexUtil.cpp.
|
static |
Converts a hexadecimal string to a "byte".
Note: if the hexadecimal string contains more than two characters, then only the last two characters will be taken into account. In this case, please note that the conversion processing will be less performant.
Caution: the result may be erroneous if the string does not contain only hexadecimal characters.
hex | The hexadecimal string to convert. |
Definition at line 97 of file HexUtil.cpp.
|
static |
Converts a hexadecimal string to a byte array.
Caution: the result may be erroneous if the string does not contain only hexadecimal characters.
hex | The hexadecimal string to convert. |
StringIndexOutOfBoundsException | If the input string is made of an odd number of characters. |
Definition at line 81 of file HexUtil.cpp.
|
static |
Converts a byte array to a hexadecimal string.
tab | The byte array to convert. |
Definition at line 145 of file HexUtil.cpp.
|
static |
Converts a "short" to a hexadecimal string.
Note: the returned string has an even length and is left truncated if necessary to keep only the significant characters.
val | The short to convert. |
Definition at line 161 of file HexUtil.cpp.
|
static |
Converts an "integer" to a hexadecimal string.
Note: the returned string has an even length and is left truncated if necessary to keep only the significant characters.
val | The integer to convert. |
Definition at line 170 of file HexUtil.cpp.
|
static |
Converts a "long" to a hexadecimal string.
Note: the returned string has an even length and is left truncated if necessary to keep only the significant characters.
val | The long to convert. |
Definition at line 189 of file HexUtil.cpp.
|
static |
Converts a "byte" to a hexadecimal string.
val | The byte to convert. |
Definition at line 156 of file HexUtil.cpp.
|
static |
Converts a hexadecimal string to an "integer".
Note: if the hexadecimal string contains more than eight characters, then only the last eight characters will be taken into account. In this case, please note that the conversion processing will be less performant.
Caution: the result may be erroneous if the string does not contain only hexadecimal characters.
hex | The hexadecimal string to convert. |
Definition at line 121 of file HexUtil.cpp.
|
static |
Converts a hexadecimal string to a "long".
Note: if the hexadecimal string contains more than sixteen characters, then only the last sixteen characters will be taken into account. In this case, please note that the conversion processing will be less performant.
Caution: the result may be erroneous if the string does not contain only hexadecimal characters.
hex | The hexadecimal string to convert. |
Definition at line 133 of file HexUtil.cpp.
|
static |
Converts a hexadecimal string to a "short".
Note: if the hexadecimal string contains more than four characters, then only the last four characters will be taken into account. In this case, please note that the conversion processing will be less performant.
Caution: the result may be erroneous if the string does not contain only hexadecimal characters.
hex | The hexadecimal string to convert. |
NullPointerException | If the input string is null. |
Definition at line 109 of file HexUtil.cpp.