Top "Gethashcode" questions

GetHashCode is method of base Object class of .Net Framework.

What is the best algorithm for overriding GetHashCode?

In .NET, the GetHashCode method is used in a lot of places throughout the .NET base class libraries. Implementing it …

.net algorithm hashcode gethashcode
Correct way to override Equals() and GetHashCode()

I have never really done this before so i was hoping that someone could show me the correct what of …

c# equality gethashcode
.NET unique object identifier

Is there a way of getting a unique identifier of an instance? GetHashCode() is the same for the two references …

c# unique hashcode gethashcode
Default implementation for Object.GetHashCode()

How does the default implementation for GetHashCode() work? And does it handle structures, classes, arrays, etc. efficiently and well enough? …

.net hash gethashcode
Overriding GetHashCode

As you know, GetHashCode returns a semi-unique value that can be used to identify an object instance in a collection. …

c# algorithm methods overriding gethashcode
What's the role of GetHashCode in the IEqualityComparer<T> in .NET?

I'm trying to understand the role of the GetHashCode method of the interface IEqualityComparer. The following example is taken from …

c# .net gethashcode iequalitycomparer
Seeding a pseudo-random number generator in C#

I need a seed for an instance of C#'s Random class, and I read that most people use the …

c# random gethashcode
How is GetHashCode() of C# string implemented?

I'm just curious because I guess it will have impact on performance. Does it consider the full string? If yes, …

c# .net string hash gethashcode
Good GetHashCode() override for List of Foo objects respecting the order

EnumerableObject : IEnumerable<Foo> wraps a List<Foo> If EnumerableObject a.SequenceEquals( EnumerableObject b), then they are …

c# algorithm hashcode gethashcode
how to implement override of GetHashCode() with logic of overriden Equals()

I have some classes as below, i have implemented the Equals(Object) method for almost all of them. But i …

c# overriding gethashcode