# Hash.createHmac256

Creates an incremental HMAC-SHA256 hasher.

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

## Imports

:::code-group
```ts [Named]
import { Hash } from 'ox/wasm'
```

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

## Examples

```ts twoslash
import { Hash, Hex } from 'ox'

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

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

## Parameters

### key

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

HMAC key.

## Return Type

An incremental HMAC-SHA256 hasher.

[`Hasher`](/wasm/crypto/Hash/types#hashhasher)
