

If that's the case, it doesn't particularly matter, so long as the scheme you use gives you unique numbers for the different strings/combinations of strings. So I understand, you effectively have some set of strings that you need to identify by hash code, and that set of strings that you need to identify among will never change?

So String.GetHashcode() should not be used for this. Quoting from Guidelines and rules for GetHashCode by Eric Lippert In the end I just concatenate the strings and compute the hashcode for the concatenation, as it is simple and worked well enough. Cat all the string together then get the hashcode.Xor with multiply the result after each string (say by 31).Xor the hash codes of all the string together.So how do I get a good hashcode? I could:
#Good hash calculator code#
So I am thinking of storing a hash code of all these strings in the main table and including it in our index, so the joins are only processed by the database when the hash code matches. We wish to be able to match on these strings quickly in a query without the performance hit of doing lots of joins. These strings are never changed once they are written to the database.In our database will store these strings in a 2nd normalised table.The number of strings is not always the same, but are nearly always of the order of a “handful”.
