---
title: implicit operator StringHash
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/stringhash/op-implicit
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/stringhash/op-implicit.md
last_updated: 2026-11-30
generated_at: 2026-11-30T20:52:26.073Z
locale: en-us
---

# implicit operator StringHash

> Converts a string into its hash, so that you can pass a string where a StringHash is expected.

## Definition

* **Type:** Operator
* **Namespace:** [Unity.Animations](/engine/7000.0/script-reference/unity/animations.md)
* **Assembly:** [UnityEngine.AnimationCoreModule](/engine/7000.0/script-reference/modules/unityengine-animationcoremodule.md)

## implicit operator StringHash(StringHas)

Converts a string into its hash, so that you can pass a string where a StringHash is expected.

```csharp
[ExcludeFromBurstCompatTesting("Takes managed string")]
public static implicit operator StringHash(string str)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The string to hash, such as a transform path or a property name.

### Returns

| Type                                                                         | Description                                                           |
| ---------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| [StringHash](/engine/7000.0/script-reference/unity/animations/stringhash.md) | The hash of the string. The hash is 0 if the string is null or empty. |

### Remarks

The conversion calls [StringHash](/engine/7000.0/script-reference/unity/animations/stringhash/ctor.md), so a null or empty string gives a hash of 0. Use it to pass a string where a `StringHash` is expected, for example `FindBoneIndex("Hips/Spine")`.

## implicit operator StringHash(StringHas)

Converts a `uint` into a `StringHash`.

```csharp
public static implicit operator StringHash(uint id)
```

### Parameters

**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): The raw hash value to wrap. It becomes [StringHash.Id](/engine/7000.0/script-reference/unity/animations/stringhash/id.md).

### Returns

| Type                                                                         | Description                                                                                                                                                                      |
| ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [StringHash](/engine/7000.0/script-reference/unity/animations/stringhash.md) | A [StringHash](/engine/7000.0/script-reference/unity/animations/stringhash.md) whose [StringHash.Id](/engine/7000.0/script-reference/unity/animations/stringhash/id.md) is `id`. |

## implicit operator StringHash(StringHas)

Implicitly converts a GenericBinding to a StringHash.

```csharp
[ExcludeFromBurstCompatTesting("Resolves the script on the main thread")]
public static implicit operator StringHash(GenericBinding binding)
```

### Parameters

**** (\[GenericBinding]\(/engine/7000.0/script-reference/unityengine/animations/genericbinding)): The GenericBinding to convert.

### Returns

| Type                                                                         | Description                                                |
| ---------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [StringHash](/engine/7000.0/script-reference/unity/animations/stringhash.md) | Returns a unique StringHash value for this GenericBinding. |

### Remarks

The hash is the same in every session, so you can serialize it. For a MonoBehaviour property, the hash includes the assembly name and full class name of the script, so renaming the script class changes it.
