mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
adds to_hex debug utility function
This commit is contained in:
@@ -79,4 +79,17 @@ std::string lookup_ws_close_status_string(uint16_t code) {
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
std::string to_hex(const std::string& input) {
|
||||
std::string output;
|
||||
std::string hex = "0123456789ABCDEF";
|
||||
|
||||
for (size_t i = 0; i < input.size(); i++) {
|
||||
output += hex[(input[i] & 0xF0) >> 4];
|
||||
output += hex[input[i] & 0x0F];
|
||||
output += " ";
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
Reference in New Issue
Block a user