Removed Utils again

This commit is contained in:
vis2k 2018-12-30 17:02:49 +01:00
parent be9206c27a
commit 283727b88a

View File

@ -123,21 +123,4 @@ public static bool UnpackMessage(byte[] message, out ushort msgType, out byte[]
return true; return true;
} }
} }
public static class Utils
{
// string.GetHashCode is not guaranteed to be the same on all machines, but
// we need one that is the same on all machines. simple and stupid:
// IMPORTANT: needs to be the same one as in Weaver
public static int GetStableHashCode(string text)
{
unchecked
{
int hash = 23;
foreach (char c in text)
hash = hash * 31 + c;
return hash;
}
}
}
} }