]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/hashcomp.cpp
Changes to m_override
[user/henk/code/inspircd.git] / src / hashcomp.cpp
index aa53da9649f8ce74de265b05cd1fa09fe67d8a1e..d3db02da488d448d08eee6a2a3f23caa5bb1b1dd 100644 (file)
 
 using namespace std;
 
-#include "inspircd_config.h"
 #include "inspircd.h"
-#include <string>
 #include "hashcomp.h"
-
 #include <ext/hash_map>
-
 #define nspace __gnu_cxx
 
 /******************************************************
@@ -279,3 +275,21 @@ const std::string irc::commasepstream::GetToken()
 irc::commasepstream::~commasepstream()
 {
 }
+
+std::string irc::hex(const unsigned char *raw, size_t rawsz)
+{
+       if (!rawsz)
+               return "";
+
+       char buf[rawsz*2+1];
+       size_t i;
+
+       for (i = 0; i < rawsz; i++)
+       {
+               sprintf (&(buf[i*2]), "%02x", raw[i]);
+       }
+       buf[i*2] = 0;
+
+       return buf;
+}
+