# SHA2

The SHA-2 (Secure Hash Algorithm 2) hash functions were designed by the NSA. SHA-2 includes significant changes from its predecessor, SHA-1. The SHA-2 family consists of hash functions with digests (hash values) that are 224, 256, 384 or 512 bits: SHA224, SHA256, SHA384, SHA512. SHA2 lives in the **Hashing** category of the `fx` menu. See [SHA-2](https://datatracker.ietf.org/doc/html/rfc6234) for format details.

## Parameters

| Parameter | Type   | Required | Default           | Description                                                                                                                      |
| --------- | ------ | -------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Input     | string | yes      | —                 | Value to transform. Previous step output or a literal.                                                                           |
| Size      | string | no       | `[object Object]` | Choose one of: `[object Object]`, `[object Object]`, `[object Object]`, `[object Object]`, `[object Object]`, `[object Object]`. |
| Rounds    | number | no       | `64`              | Numeric value. Default `64`.                                                                                                     |
| Rounds    | number | no       | `160`             | Numeric value. Default `160`.                                                                                                    |

`Input` is the primary value (previous step output or a literal).

## Returned value

| Type     | Description                        |
| -------- | ---------------------------------- |
| `string` | Result of the SHA2 transformation. |

## Limitations

- This operation treats Input as raw bytes (binary-capable). Non-text payloads may display differently after decoding.
- Wrong key, algorithm options, or malformed input typically raises an evaluation error — fix Input or options before re-running.

## Example

<details>
<summary>Run SHA2</summary>

The SHA-2 (Secure Hash Algorithm 2) hash functions were designed by the NSA. Adjust optional parameters when the defaults do not match your payload.

1. Set **Input** to the value to transform (previous step output or a literal).

2. Review **Size**, **Rounds**, **Rounds** and keep defaults unless your format requires otherwise.

3. Confirm **Output value** shows the transformed result.

</details>
