# GetHashCode()

> Computes a hash code for this identifier.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public override int GetHashCode()
```

### Returns

| Type                                                       | Description                                         |
| ---------------------------------------------------------- | --------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | An integer hash code derived from the culture code. |

### Remarks

Consistent with [LocaleIdentifier.Equals](/engine/6000.7/script-reference/unity/localization/localeidentifier/equals.md): identifiers that compare equal produce the same hash code, because the code is hashed case-insensitively. The undefined identifier hashes to `0`. Safe to use as a dictionary key.

Use an identifier as a dictionary key.

### Examples

```csharp
using System.Collections.Generic;
using Unity.Localization;

namespace Unity.Localization.Samples
{
    public class LocaleIdentifierHashCodeExample
    {
        public void Run(LocaleIdentifier identifier)
        {
            var counts = new Dictionary<LocaleIdentifier, int>();
            counts[identifier] = counts.GetValueOrDefault(identifier) + 1;
        }
    }
}
```
