summaryrefslogtreecommitdiff
path: root/src/utils/cpp/hex_string.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/cpp/hex_string.hpp')
-rw-r--r--src/utils/cpp/hex_string.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils/cpp/hex_string.hpp b/src/utils/cpp/hex_string.hpp
index 44e0adf6..23544d49 100644
--- a/src/utils/cpp/hex_string.hpp
+++ b/src/utils/cpp/hex_string.hpp
@@ -15,6 +15,7 @@
#ifndef INCLUDED_SRC_UTILS_CPP_HEX_STRING_HPP
#define INCLUDED_SRC_UTILS_CPP_HEX_STRING_HPP
+#include <cstddef>
#include <iomanip>
#include <iostream>
#include <optional>
@@ -35,9 +36,9 @@
[[nodiscard]] static inline auto FromHexString(std::string const& hexstring)
-> std::optional<std::string> {
try {
- const size_t kHexBase = 16;
+ const std::size_t kHexBase = 16;
std::stringstream ss{};
- for (size_t i = 0; i < hexstring.length(); i += 2) {
+ for (std::size_t i = 0; i < hexstring.length(); i += 2) {
unsigned char c =
std::stoul(hexstring.substr(i, 2), nullptr, kHexBase);
ss << c;