Possible Duplicate:
Can I depend on the values of GetHashCode() to be consistent?
If I use the Object.GetHashCode()
method across two systems/framework versions, am I guaranteed to get the same value for the same input? In other words, does its value make a good key for persistent data?
Note: I don't care about collisions in this problem.
As a bonus, am I guaranteed to get the same value in Mono vs. Microsoft .Net?
No. Other questions? :-)
The algorithms used aren't published nor they are in the Ecma standard.
I'll quote from the MSDN String.GetHashCode (I think that this example is good enough)
The behavior of GetHashCode is dependent on its implementation, which might change from one version of the common language runtime to another. A reason why this might happen is to improve the performance of GetHashCode.