11 std::string outString;
13 unsigned char* b = (
unsigned char*) ptr;
20 for (
int i =
size - 1; i >= 0; i--) {
21 for (
int j = 7; j >= 0; j--) {
22 byte = (b[i] >> j) & 1;
23 snprintf(cStr, buf_size,
"%u",
byte);
24 outString.append(cStr);
36 std::string outString;
38 unsigned char* b = (
unsigned char*) ptr;
45 for (
int i =
size - 1; i >= 0; i--) {
47 snprintf(cStr, buf_size,
"%02x",
byte);
48 outString.append(cStr);
56 std::string outString;
58 unsigned char* b = (
unsigned char*) ptr;
59 unsigned char byte[4];
60 byte[0] = b[3] & 0xff;
61 byte[1] = b[2] & 0xff;
62 byte[2] = b[1] & 0xff;
63 byte[3] = b[0] & 0xff;
69 snprintf(cStr, buf_size,
"%02x%02x %02x%02x",
byte[0],
byte[1],
byte[2],
byte[3]);
71 outString.append(cStr);
78 std::string outString;
80 unsigned char* b = (
unsigned char*) ptr;
81 unsigned char byte[4];
82 byte[0] = b[0] & 0xff;
83 byte[1] = b[1] & 0xff;
84 byte[2] = b[2] & 0xff;
85 byte[3] = b[3] & 0xff;
91 snprintf(cStr, buf_size,
"%02x%02x %02x%02x",
byte[0],
byte[1],
byte[2],
byte[3]);
93 outString.append(cStr);
100 unsigned char* b = (
unsigned char*) ptr;
101 unsigned char byte[4];
102 byte[0] = b[3] & 0xff;
103 byte[1] = b[2] & 0xff;
104 byte[2] = b[1] & 0xff;
105 byte[3] = b[0] & 0xff;
115 size_t nWords =
size / 4;
118 for (
size_t iWord = 0; iWord < nWords; iWord++) {
128 std::cout << std::endl;
static constexpr size_t size()
std::string GetHexRepresentation(size_t const size, uint8_t const *const ptr)
void PrintRaw(size_t const size, uint8_t const *const ptr)
std::string GetBinaryRepresentation(size_t const size, uint8_t const *const ptr)
std::string GetWordHexReprInv(uint8_t const *const ptr)
std::string GetWordHexRepr(uint8_t const *const ptr)
void SwapBytes(size_t const size, uint8_t const *ptr)