From ea12ff233b985bd9db6f99eee07fefde80811a94 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 2 Sep 2009 18:14:10 -0500 Subject: [8450] Prevented using of plaintext passwords in sql queries Author: arrai --HG-- branch : trunk --- src/shared/Util.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/shared/Util.cpp') diff --git a/src/shared/Util.cpp b/src/shared/Util.cpp index 41ed9c0fa8b..ede7a27ea7b 100644 --- a/src/shared/Util.cpp +++ b/src/shared/Util.cpp @@ -502,3 +502,23 @@ void vutf8printf(FILE *out, const char *str, va_list* ap) vfprintf(out, str, *ap); #endif } + +void hexEncodeByteArray(uint8* bytes, uint32 arrayLen, std::string& result) +{ + std::ostringstream ss; + for(uint32 i=0; i>((1-j)*4)); + char encodedNibble; + if(nibble < 0x0A) + encodedNibble = '0'+nibble; + else + encodedNibble = 'A'+nibble-0x0A; + ss << encodedNibble; + } + } + result = ss.str(); +} + -- cgit v1.2.3