diff --git a/src/util.h b/src/util.h index a563f9c..c7bd54e 100644 --- a/src/util.h +++ b/src/util.h @@ -246,6 +246,19 @@ enum class ExtendedChar { GreekSmallLetterPhi = 0xed, }; +String hexDump(String in) { + String out; + for (size_t i = 0; i < in.length(); ++i) { + auto hexChar = String(in[i], HEX); + if (hexChar.length() == 1) { + out.concat('0'); + } + out.concat(hexChar); + out.concat(' '); + } + return out; +} + /* * Message syntax: * separator: ~