> **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.

# Hash.createHmac256

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

Creates an incremental HMAC-SHA256 hasher.

The installed Engine provider is captured when this function is called.

## Imports

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

## Examples

```ts twoslash
// @noErrors
import { Hash, Hex } from 'viem/utils'

const hash = Hash.createHmac256(Hex.fromString('key'))
hash.update('0xdead')
hash.update('0xbeef')
hash.digest()
```

## Definition

```ts
function createHmac256(
  key: Hex.Hex | Bytes.Bytes,
): Hasher
```

## Parameters

### key

* **Type:** `Hex.Hex | Bytes.Bytes`

HMAC key.

## Return Type

An incremental HMAC-SHA256 hasher.

[`Hasher`](/docs/utilities/hash/types#hashhasher)
