summaryrefslogtreecommitdiff
path: root/src/inspstring.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-10 17:06:52 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-10 17:06:52 +0000
commit26cd5393c9308fabe73c41870f06f73a5b001cd7 (patch)
treef9cfd6afe3b35ea81add40d4bb5246a66a536f16 /src/inspstring.cpp
parent892b3fde2fa974e339f049283d8d3e5f75a49107 (diff)
Update m_cloaking to use free-form keys instead of weakening the hash IV
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11820 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspstring.cpp')
-rw-r--r--src/inspstring.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/inspstring.cpp b/src/inspstring.cpp
index f11ea1248..ff9c1875f 100644
--- a/src/inspstring.cpp
+++ b/src/inspstring.cpp
@@ -136,3 +136,19 @@ CoreExport bool charremove(char* mp, char remove)
return shift_down;
}
+
+static const char hextable[] = "0123456789abcdef";
+
+std::string BinToHex(const std::string& data)
+{
+ int l = data.length();
+ std::string rv;
+ rv.reserve(l * 2);
+ for(int i=0; i < l; i++)
+ {
+ unsigned char c = data[i];
+ rv.append(1, hextable[c >> 4]);
+ rv.append(1, hextable[c & 0xF]);
+ }
+ return rv;
+}