Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I suspect the reason your hashcodes are changing is that you have not overriden GetHashCode() in your class that combines your three fields, so it is using the default implemenation which will return a hashcode specific to the particular object (not its values). However, I would recommend not using <code>GetHashCode</code> at all for your problem as you need these values to persist to disk and be useful between invocations of your application.</p> <p><code>GetHashCode()</code> returns a hash that you can rely on only within the context of a single process instance (a single run). Implementations of <code>GetHashCode</code> are free to return values that are based upon memory ordering of elements which can change between process runs and, in addition, the values generated may differ between process architecture or between versions of .NET. See the <a href="http://msdn.microsoft.com/en-us/library/system.object.gethashcode.aspx" rel="nofollow">documenation of GetHashCode</a> for more details.</p> <p>If you want something you can rely on when saved to disk and reloaded, you should switch to a hash function with behaviour that is well defined (or, alternatively, that you can control). A list of such algorithms can be found on the '<a href="http://en.wikipedia.org/wiki/List_of_hash_functions" rel="nofollow">list of hash functions</a>' Wikipedia page. In particular, the non-cryptographic ones are suitable for this task. (Although there is no reason, other than performance, why you couldn't use a cryptographic one.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload