# GetShapeHash()

> Generates a simple hash value based upon the geometry of the Collider2D.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.3/script-reference/unityengine.md)
* **Assembly:** UnityEngine.Physics2DModule

```csharp
public uint GetShapeHash()
```

### Returns

| Type                                                         | Description                                                                                                                                   |
| ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | A hash value that uniquely identifies the configured geometry of the [Collider2D](/engine/6000.3/script-reference/unityengine/collider2d.md). |

### Remarks

The geometry of a [Collider2D](/engine/6000.3/script-reference/unityengine/collider2d.md) can be configured by various properties on all of the [Collider2D](/engine/6000.3/script-reference/unityengine/collider2d.md) types such as the radius of a [CircleCollider2D](/engine/6000.3/script-reference/unityengine/circlecollider2d.md) or the size of a [BoxCollider2D](/engine/6000.3/script-reference/unityengine/boxcollider2d.md). The geometry created as opposed to the properties used to generate them are what is is hashed here. Two different [Collider2D](/engine/6000.3/script-reference/unityengine/collider2d.md) that are configured to produce the same geometry produce the same hash.

This hash can be used to determine if the [Collider2D](/engine/6000.3/script-reference/unityengine/collider2d.md) geometry is the same as another [Collider2D](/engine/6000.3/script-reference/unityengine/collider2d.md) geometry or if the geometry has changed by comparing against previous hash values.

A common use-case is when using [Collider2D.CreateMesh](/engine/6000.3/script-reference/unityengine/collider2d/createmesh.md) where it is useful to determine if the resulting [Mesh](/engine/6000.3/script-reference/unityengine/mesh.md) would change due to the [Collider2D](/engine/6000.3/script-reference/unityengine/collider2d.md) geometry changing.

Additional Resources: [Collider2D.CreateMesh](/engine/6000.3/script-reference/unityengine/collider2d/createmesh.md).
