Functions | |
std::string | to_hexstring (const boost::uint8_t *bytes, const size_t length) |
Convers the given byte array of the given length to a corresponding hexadecimal number in a string. More... | |
std::string | to_hexstring (const std::string &bytes) |
Convers the given byte array of the given length to a corresponding hexadecimal number in a human readable string. More... | |
std::string | to_binstring (const boost::container::vector< boost::uint8_t > &byteArray) |
Convers the given byte array of the given length to a corresponding binary number in a string. More... | |
boost::uint8_t | from_hexchar (char highNibbleChar, char lowNibbleChar) |
Converts the given hexChars to the byte corresponding. More... | |
boost::container::vector< boost::uint8_t > | from_hexstring (const std::string &hexString) |
This function can be used to parse a string of hexadecimal number back into bits representation. Note that it runs from left to right, putting eventually the last nibble empty if the size of the input string isn't a multiple of 2. More... | |
std::string | buffer_from_hexstring (const std::string &hex) |
Converts a string of hexadecimal number into a binary buffer of this valeu. More... | |
template<typename intX_t > | |
intX_t | from_byteArray (const boost::container::vector< boost::uint8_t > &byteArray) |
This function transforms any byteArray in the chosen (u)int*_t type. More... | |
boost::shared_ptr< boost::container::vector< boost::uint8_t > > | load_bytearray (const std::string binaryFilePath) |
This methods opens up a file and parses it's bytes into a bytearray. More... | |
Variables | |
const size_t | NIBBLE_BITS = 4 |
Constant telling how much bits there is in a nibble. | |
const size_t | BYTE_NIBBLES = 2 |
Constant telling how much Nibbles are in a byte. | |
Detailed Description
Utilities to print bytes, transform them to string, reading them from files...
Function Documentation
|
inline |
Converts a string of hexadecimal number into a binary buffer of this valeu.
- Parameters
-
hex byte string
|
inline |
This function transforms any byteArray in the chosen (u)int*_t type.
- Parameters
-
byteArray To transform into native uint
- Returns
- The int requested with the value of the byteArray.
|
inline |
Converts the given hexChars to the byte corresponding.
- Parameters
-
highNibbleChar lowNibbleChar
|
inline |
This function can be used to parse a string of hexadecimal number back into bits representation. Note that it runs from left to right, putting eventually the last nibble empty if the size of the input string isn't a multiple of 2.
- Parameters
-
hexString to convert
|
inline |
This methods opens up a file and parses it's bytes into a bytearray.
- Parameters
-
binaryFilePath Where to find the file to load
- Returns
- The bytearray corresponding to the file content
- Exceptions
-
std::runtime_error In case the file isn't found.
|
inline |
Convers the given byte array of the given length to a corresponding binary number in a string.
- Parameters
-
byteArray Array of bytes
|
inline |
Convers the given byte array of the given length to a corresponding hexadecimal number in a string.
- Parameters
-
bytes Array of bytes length Length of the byte array
Constant array which can be used to convert hex strings to real nibbles.
|
inline |
Convers the given byte array of the given length to a corresponding hexadecimal number in a human readable string.
- Parameters
-
bytes buffer of bytes
Constant array which can be used to convert hex strings to real nibbles.