Hash calculation for array of long values in C#
You could use XOR to combine hashes which is much faster than your calculation:

int hash = 0;
for(int i = 0; i &lt; array.Length; i++)
    hash ^= array[i].GetHashCode();
return hash;