# GetHashCode()

> Computes a hash code for this key.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization.Providers](/engine/6000.7/script-reference/unity/localization/providers.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 address, sub-asset name, and type. |

### Remarks

Consistent with [AssetKey.Equals](/engine/6000.7/script-reference/unity/localization/providers/assetkey/equals.md): keys that compare equal produce the same hash code. Derived from the address, sub-asset name, and type, so a key is safe to use as a dictionary key for a load cache.

Use a key as a dictionary key for loaded assets.

### Examples

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

namespace Unity.Localization.Samples
{
    public class AssetKeyHashCodeExample
    {
        public void Run()
        {
            var loaded = new Dictionary<AssetKey, Texture2D>();
            var key = new AssetKey("UI/Logo", typeof(Texture2D));
            loaded[key] = new Texture2D(2, 2);

            Debug.Log(loaded.ContainsKey(new AssetKey("UI/Logo", typeof(Texture2D))));   // True
        }
    }
}
```
