> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sdf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Binary Functions

## `sha256`

Computes the SHA256 hash of binary.

*Examples:*

```sql examples.sql theme={null}
select sha256('Hello World!') as value; -- value '7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069'
```

*Supported Signatures*

```sql theme={null}
function sha256(varbinary) returns varbinary
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/binary.html#sha256)

## `sha512`

Computes the SHA512 hash of binary.

*Examples:*

```sql examples.sql theme={null}
select sha512('Hello World!') as value; -- value '861844d6704e8573fec34d967e20bcfef3d424cf48be04e6dc08f2bd58c729743371015ead891cc3cf1c9d34b49264b510751b1ff9e537937bc46b5d6ff4ecc8'
```

*Supported Signatures*

```sql theme={null}
function sha512(varbinary) returns varbinary
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/binary.html#sha512)

## `to_hex`

Encodes binary into a hex string representation.

*Examples:*

```sql examples.sql theme={null}
SELECT to_hex(cast(1000 as varbinary)) AS value; -- value 'e8030000'
```

*Supported Signatures*

```sql theme={null}
function to_hex(varbinary) returns varchar
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/binary.html#to_hex)
