I am implementing a custom GetHashCode for the System.Drawing.Point class in C #. My method currently does not fulfill the following requirement:
var hashA = MyGetHashCode(new Point(1, 0));
var hashB = MyGetHashCode(new Point(0, 1));
var hashC = MyGetHashCode(new Point(0, 0));
var hashD = MyGetHashCode(new Point(1, 1));
Assert.AreNotEqual(hashA ^ hashB, hashC ^ hashD);
To pass this test, I am sure that with the new SHA256Managed (), ComputeHash (currentHash) will work. But is there any other hash algorithm? I know that SHA256 is about security, and I don't need it.
source
share