# Hash functions

This page describes the additional set of predefined Jsonnet functions for the [Data Transformer Script](https://docs.cloud.google.com/application-integration/docs/configure-data-transformer-script-task.md.txt) task available in Application Integration.

### Before you begin


To use the following predefined functions, you must import the `functions` library in your script. Importing the `functions` library lets you use both the standard Jsonnet functions and the predefined **Data Transformer** functions.


Application Integration supports Jsonnet functions library v0.20.0. For information about the Jsonnet standard functions, see [Jsonnet Standard Library](https://jsonnet.org/ref/stdlib.html).

*** ** * ** ***

### `SHA1`

| Syntax | ```html sha1(str) ``` |
| Description | Computes the cryptographic hash of the input `STRING` using the [Secure Hash Algorithm 1 (SHA-1)](https://en.wikipedia.org/wiki/SHA-1) algorithm. > [!WARNING] > **Warning:** SHA1 is no longer considered secure. For increased security, use another hashing function. |
| Input parameter | **str:** The input string. |
| Return type | `BYTES` |
| Output | Returns a 160 bit (20-byte) hash value. |
|---|---|

*** ** * ** ***

### `SHA256`

| Syntax | ```html sha256(str) ``` |
| Description | Computes the cryptographic hash of the input `STRING` using the [Secure Hash Algorithm 256 (SHA-256)](https://en.wikipedia.org/wiki/SHA-2) algorithm. |
| Input parameter | **str:** The input string. |
| Return type | `BYTES` |
| Output | Returns a 256 bit (32-byte) hash value. |
|---|---|

*** ** * ** ***

### `SHA512`

| Syntax | ```html sha512(str) ``` |
| Description | Computes the cryptographic hash of the input `STRING` using the [Secure Hash Algorithm 512 (SHA-512)](https://en.wikipedia.org/wiki/SHA-2) algorithm. |
| Input parameter | **str:** The input string. |
| Return type | `BYTES` |
| Output | Returns a 512 bit (64-byte) hash value. |
|---|---|

*** ** * ** ***

### `SHA3`

| Syntax | ```html sha3(str) ``` |
| Description | Computes the cryptographic hash of the input `STRING` using the [Secure Hash Algorithm 3 (SHA-3)](https://en.wikipedia.org/wiki/SHA-3) algorithm. |
| Input parameter | **str:** The input string. |
| Return type | `BYTES` |
| Output | Returns a 512 bit (64-byte) hash value. |
|---|---|

## Recommendation

- Learn how to add and configure a [Data Transformer Script task](https://docs.cloud.google.com/application-integration/docs/configure-data-transformer-script-task.md.txt)