.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

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -