# `SHA256`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Calculates the SHA-256 hash of data, returning the result as binary data.

## Syntax

```sql
sha256(<data>)
```

## Arguments

### Required

- `<data>`: The text or bytea data to hash.

## Returns

Returns a bytea that contains the SHA-256 hash.

## Considerations

- SHA-256 is cryptographically secure.
- Use `encode(sha256(<data>), 'hex')` for human-readable hexadecimal output.

## Examples

### Calculate SHA-256 Hash

Get the SHA-256 hash of a string.

```sql
SELECT sha256('abc') AS result;
```

Returns `\xba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad`.

## Related Documentation

- [String Types](/docs/data/data-cloud-query-guide/references/dc-sql-reference/string.md)
