> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# TypedData.hashDomain

:::info
`TypedData.hashDomain` is a re-export of ox's [`TypedData.hashDomain`](https://oxlib.sh/api/TypedData/hashDomain). Refer to the ox documentation for the full reference.
:::

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

## Imports

```ts
import { TypedData } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { TypedData } from 'viem/utils'

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

## Definition

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

## 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`
