# Hash

Ox's hash API and its supported Node.js engine primitives.

## Examples

```ts twoslash
// @noErrors
import { Engine } from 'ox'
import { Hash } from 'ox/node'

await Engine.install({ Hash: Hash.engine() })

Hash.sha256('0xdeadbeef')
```

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Hash.blake3`](/node/crypto/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`](/node/crypto/Hash/createBlake3) | Creates an incremental BLAKE3 hasher. |
| [`Hash.createHmac256`](/node/crypto/Hash/createHmac256) | Creates an incremental HMAC-SHA256 hasher. |
| [`Hash.createKeccak256`](/node/crypto/Hash/createKeccak256) | Creates an incremental Keccak256 hasher. |
| [`Hash.createRipemd160`](/node/crypto/Hash/createRipemd160) | Creates an incremental RIPEMD-160 hasher. |
| [`Hash.createSha256`](/node/crypto/Hash/createSha256) | Creates an incremental SHA-256 hasher. |
| [`Hash.engine`](/node/crypto/Hash/engine) | Creates a Node.js implementation of the [`Hash`](/api/Hash) engine slot, without installing it. |
| [`Hash.hmac256`](/node/crypto/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`](/node/crypto/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`](/node/crypto/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`](/node/crypto/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`](/node/crypto/Hash/validate) | Checks if a string is a valid hash value. |

## Errors

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

## Types

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