.net - stable hashcode for IStructuralEquatable object -
I need to create a static (= does not vary with time) Hashod of an object. Specifically, I do not know the precise type of object, the only assumption is that it is obtained from the IST Strategy.
So I need a method:
Fixed String GetStableHashcode & lt; T & gt; (T object) where T: IST Structure Accelerator The Net Framework provides this type of function? Otherwise, which algorithm to use?
Each object should use the hashode based on the object's content. If you have a type of value containing 3 ints, then use them when calculating the hash code.
Similarly, all objects with the same content will have the same hash code, which will be different from the app domain and other conditions.
An example for a good hash code can be found.
Comments
Post a Comment