diff options
Diffstat (limited to 'src/server/shared/Utilities/Util.cpp')
-rwxr-xr-x | src/server/shared/Utilities/Util.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index 6ae43bc6840..52ce74be8f8 100755 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -16,6 +16,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <iostream> #include "Util.h" #include "utf8.h" #ifdef USE_SFMT_FOR_RNG @@ -529,3 +530,15 @@ void hexEncodeByteArray(uint8* bytes, uint32 arrayLen, std::string& result) result = ss.str(); } +std::string ByteArrayToHexStr(uint8* bytes, uint32 length) +{ + std::ostringstream ss; + for (uint32 i = 0; i < length; ++i) + { + char buffer[4]; + sprintf(buffer, "%02X ", bytes[i]); + ss << buffer; + } + + return ss.str(); +} |