|
1 | 1 | #include <algorithm>
|
| 2 | +#include <array> // Add this include for std::array |
2 | 3 | #include <cstdint>
|
3 | 4 | #include <cstdlib>
|
4 | 5 | #include <cstring>
|
5 | 6 | #include <gmp.h>
|
6 | 7 | #include <stdexcept>
|
7 | 8 | #include <unordered_set>
|
8 |
| -#include <array> // Add this include for std::array |
9 | 9 |
|
10 | 10 | #include "runtime/alloc.h"
|
11 | 11 | #include "runtime/header.h"
|
@@ -164,9 +164,11 @@ SortBytes hook_BYTES_string2bytes(SortString s) {
|
164 | 164 | }
|
165 | 165 |
|
166 | 166 | string *bytes2hexstring(string *b, size_t len) {
|
167 |
| - static const std::array<char, 16> hexchars = {'0', '1', '2', '3', '4', '5', '6', '7', |
168 |
| - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; |
169 |
| - auto *result = static_cast<string *>(kore_alloc_token(sizeof(string) + len * 2)); |
| 167 | + static const std::array<char, 16> hexchars |
| 168 | + = {'0', '1', '2', '3', '4', '5', '6', '7', |
| 169 | + '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; |
| 170 | + auto *result |
| 171 | + = static_cast<string *>(kore_alloc_token(sizeof(string) + len * 2)); |
170 | 172 | for (size_t i = 0; i < len; i++) {
|
171 | 173 | result->data[i * 2] = hexchars.at((b->data[i] >> 4) & 0xf);
|
172 | 174 | result->data[i * 2 + 1] = hexchars.at(b->data[i] & 0xf);
|
|
0 commit comments