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

Backed by `blake3` from [`@noble/hashes`](https://github.com/paulmillr/noble-hashes), an audited & minimal JS hashing library, unless another implementation is installed with [`Engine.set`](/node/crypto/Engine/set).

## Imports

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

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

## Examples

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

Hash.blake3('0xdeadbeef')
// @log: '0x53147f3ce49ed4f60dfa5b9654c36ba6103c11f5737df3dabd4cbd296c4161bd'
```

### Configure Return Type

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

Hash.blake3('0xdeadbeef', { as: 'Bytes' })
// @log: Uint8Array [...]
```

## Definition

```ts
function blake3<value, as>(
  value: value | Hex.Hex | Bytes.Bytes,
  options?: blake3.Options<as>,
): blake3.ReturnType<as>
```

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

## Parameters

### value

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

[`Bytes.Bytes`](/api/Bytes/types#bytes) or [`Hex.Hex`](/api/Hex/types#hex) value.

### options

* **Type:** `blake3.Options<as>`
* **Optional**

Options.

#### options.as

* **Type:** `"Bytes" | "Hex" | as`
* **Optional**

The return type. Defaults to the input format.

## Return Type

BLAKE3 hash.

`blake3.ReturnType<as>`
