I don't have a C compiler, so I can’t check if it works the same way, but I think the following is true:
private static ulong SBDM(string str)
{
ulong hash = 0;
foreach (char c in str)
{
hash = c + (hash << 6) + (hash << 16) - hash;
}
return hash;
}
If you just need to get the hash of the string and it doesn't really matter what the implementation is, you can always do the command String.GetHashCode ();
source
share