Closed nehmebilal closed 9 years ago
You will always get the same value for the same string your're trying to hash. But the GetHashCode() will change everytime. Also there is no method of GetHashCode that takes 1 argument.
xxhash is a Non-cryptographic hash method.
xxHash returns a byte array that you will have to convert.
xxHash h = new xxHash();
int nodeIndex = BitConverter.ToInt32(h.ComputeHash(sessionId)) % nodeCount;
Nodes[nodeIndex].Dowork()
This will always give you the same nodeIndex as long as your nodeCount doesn't change.
Perfect thanks!
Hi,
I am trying to use your library to get the hash code of a given string. I'd like to use the hash code for load balancing and I'm looking for a consistent hash code (for a given string, I always get the same hash code).
Here is what it looks like:
Does this library provide such functionality?