# TypedData.hashDomain

Hashes [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712) domain.

## Imports

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

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

## Examples

```ts twoslash
import { TypedData } from 'ox'

TypedData.hashDomain({
  domain: {
    name: 'Ether Mail',
    version: '1',
    chainId: 1,
    verifyingContract:
      '0x0000000000000000000000000000000000000000'
  }
})
// @log: '0x6192106f129ce05c9075d319c1fa6ea9b3ae37cbd0c1ef92e2be7137bb07baa1'
```

## Definition

```ts
function hashDomain(
  value: hashDomain.Value,
): Hex.Hex
```

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

## Parameters

### value

* **Type:** `hashDomain.Value`

The Typed Data domain and types.

#### value.EIP712Domain

* **Type:** `readonly abitype.TypedDataParameter[]`
* **Optional**

#### value.domain

* **Type:** `abitype.TypedDataDomain`

The Typed Data domain.

#### value.typeHashes

* **Type:** `Map`
* **Optional**

Optional cache of `keccak256(encodeType(t))` keyed by type name, shared across nested struct/array calls.

#### value.types

* **Type:** `{ [key: string]: readonly abitype.TypedDataParameter[]; EIP712Domain?: readonly abitype.TypedDataParameter[]; }`
* **Optional**

The Typed Data types.

## Return Type

The hashed domain.

`Hex.Hex`
