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

This function is a re-export of `sha256` from [`@noble/hashes`](https://github.com/paulmillr/noble-hashes), an audited & minimal JS hashing library.

## Imports

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

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

## Examples

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

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

## Definition

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

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

## Parameters

### value

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

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

### options

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

Options.

#### options.as

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

The return type.

## Return Type

Sha256 hash.

`sha256.ReturnType<as>`
