# Ens.namehash

Hashes ENS name.

Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `namehash`. 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.namehash('wevm.eth')
// @log: '0xf246651c1b9a6b141d19c2604e9a58f567973833990f830d882534a747801359'
```

## Definition

```ts
function namehash(
  name: string,
): `0x${string}`
```

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

## Parameters

### name

* **Type:** `string`

ENS name.

## Return Type

ENS namehash.

`0x${string}`
