#ifndef INCLUDED_SRC_UTILS_CPP_HEX_STRING_HPP #define INCLUDED_SRC_UTILS_CPP_HEX_STRING_HPP #include #include #include [[nodiscard]] static inline auto ToHexString(std::string const& bytes) -> std::string { std::ostringstream ss{}; ss << std::hex << std::setfill('0'); for (auto const& b : bytes) { ss << std::setw(2) << static_cast(static_cast(b)); } return ss.str(); } #endif // INCLUDED_SRC_UTILS_CPP_HEX_STRING_HPP