# Hash

Utility functions for hashing (keccak256, sha256, etc).

## Examples

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

const value = Hash.keccak256('0xdeadbeef')
// '0xd4fd4e189132273036449fc9e11198c739161b4c0116a9a2dccdfa1c492006f1'
```

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Hash.blake3`](/api/Hash/blake3) | Calculates the [BLAKE3](https://github.com/BLAKE3-team/BLAKE3) hash of a [`Bytes.Bytes`](/api/Bytes/types#bytes) or [`Hex.Hex`](/api/Hex/types#hex) value. |
| [`Hash.createBlake3`](/api/Hash/createBlake3) | Creates an incremental BLAKE3 hasher. |
| [`Hash.createHmac256`](/api/Hash/createHmac256) | Creates an incremental HMAC-SHA256 hasher. |
| [`Hash.createKeccak256`](/api/Hash/createKeccak256) | Creates an incremental Keccak256 hasher. |
| [`Hash.createRipemd160`](/api/Hash/createRipemd160) | Creates an incremental RIPEMD-160 hasher. |
| [`Hash.createSha256`](/api/Hash/createSha256) | Creates an incremental SHA-256 hasher. |
| [`Hash.hmac256`](/api/Hash/hmac256) | Calculates the [HMAC-SHA256](https://en.wikipedia.org/wiki/HMAC) of a [`Bytes.Bytes`](/api/Bytes/types#bytes) or [`Hex.Hex`](/api/Hex/types#hex) value. |
| [`Hash.keccak256`](/api/Hash/keccak256) | Calculates the [Keccak256](https://en.wikipedia.org/wiki/SHA-3) hash of a [`Bytes.Bytes`](/api/Bytes/types#bytes) or [`Hex.Hex`](/api/Hex/types#hex) value. |
| [`Hash.ripemd160`](/api/Hash/ripemd160) | Calculates the [Ripemd160](https://en.wikipedia.org/wiki/RIPEMD) hash of a [`Bytes.Bytes`](/api/Bytes/types#bytes) or [`Hex.Hex`](/api/Hex/types#hex) value. |
| [`Hash.sha256`](/api/Hash/sha256) | Calculates the [Sha256](https://en.wikipedia.org/wiki/SHA-256) hash of a [`Bytes.Bytes`](/api/Bytes/types#bytes) or [`Hex.Hex`](/api/Hex/types#hex) value. |
| [`Hash.validate`](/api/Hash/validate) | Checks if a string is a valid hash value. |

## Errors

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Hash.HasherDestroyedError`](/api/Hash/errors#hashhasherdestroyederror) | Thrown when an incremental hash state has been consumed or destroyed. |
| [`Hash.InvalidDigestSizeError`](/api/Hash/errors#hashinvaliddigestsizeerror) | Thrown when a digest output buffer is too small. |

## Types

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Hash.Hasher`](/api/Hash/types#hashhasher) | Incremental hash state. |
