# CalculateStableTypeHash

> Calculates a stable type hash for the input type.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

## CalculateStableTypeHash(Type, IEnumerable\<CustomAttributeData>, Dictionary\<Type, ulong>)

Calculates a stable type hash for the input type.

```csharp
public static ulong CalculateStableTypeHash(Type type, IEnumerable<CustomAttributeData> customAttributes = null, Dictionary<Type, ulong> hashCache = null)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): Type to hash.**** (\[IEnumerable\<CustomAttributeData>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)): Custom attributes for the provided type (if any).**** (\[Dictionary\<Type, ulong>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)): Cache for Types and their hashes. Used for quicker lookups when hashing.

### Returns

| Type                                                          | Description                        |
| ------------------------------------------------------------- | ---------------------------------- |
| [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | StableTypeHash for the input type. |

### Remarks

This hash is NOT expected to remain the same across versions.

## CalculateStableTypeHash(Type, Dictionary\<Type, ulong>)

Calculates a stable type hash for the input type.

```csharp
public static ulong CalculateStableTypeHash(Type type, Dictionary<Type, ulong> hashCache)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): Type to hash.**** (\[Dictionary\<Type, ulong>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)): Cache for Types and their hashes. Used for quicker lookups when hashing.

### Returns

| Type                                                          | Description                        |
| ------------------------------------------------------------- | ---------------------------------- |
| [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | StableTypeHash for the input type. |

### Remarks

This hash is NOT expected to remain the same across versions.
