News for hackers. Stuff that matters.

deedee

Ask HN: What is wrong with my implementation of DJBX33X hashing function in C#?

I implemented DJBX33X hashing function in C# like this:public static long hash(string str) {               long hash = 5381;     for (int i = 0; i < str.Length; i++)     {         hash = ((hash << 5) + hash) ^ (int)str[i];     }     return hash; } but if I compare results of my function...

( Read More... | no comments | on HN )