# GetHashCode()

A method that produces an integer used by hash-based collections.

## What does **GetHashCode()** do in C#?

**GetHashCode()** — A method that produces an integer used by hash-based collections.

```csharp
record Product(string Name)
{
    public int Hash()
    {
        return GetHashCode();
    }
}
```

Level: Journeyman · [More C# terms at this level](https://www.ask-codey.com/glossary/subjects/c-sharp/journeyman)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/gethashcode
