# Ens.labelhash

Hashes ENS label.

Since ENS labels prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS labels](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `labelhash`. You can use the built-in [`Ens.normalize`](/api/Ens/normalize) function for this.

## Imports

:::code-group
```ts [Named]
import { Ens } from 'ox'
```

```ts [Entrypoint]
import * as Ens from 'ox/Ens'
```
:::

## Examples

```ts twoslash
import { Ens } from 'ox'
Ens.labelhash('eth')
;('0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0')
```

## Definition

```ts
function labelhash(
  label: string,
): `0x${string}`
```

**Source:** [src/core/Ens.ts](https://github.com/wevm/ox/blob/main/src/core/Ens.ts#L142)

## Parameters

### label

* **Type:** `string`

ENS label.

## Return Type

ENS labelhash.

`0x${string}`
