Hash functions

This page describes the additional set of predefined Jsonnet functions for the Data Transformer Script 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.

SHA1

Syntax
        
sha1(str)
      
Description Computes the cryptographic hash of the input STRING using the Secure Hash Algorithm 1 (SHA-1) algorithm.
Input parameter str: The input string.
Return type BYTES
Output Returns a 160 bit (20-byte) hash value.

SHA256

Syntax
        
sha256(str)
      
Description Computes the cryptographic hash of the input STRING using the Secure Hash Algorithm 256 (SHA-256) algorithm.
Input parameter str: The input string.
Return type BYTES
Output Returns a 256 bit (32-byte) hash value.

SHA512

Syntax
        
sha512(str)
      
Description Computes the cryptographic hash of the input STRING using the Secure Hash Algorithm 512 (SHA-512) algorithm.
Input parameter str: The input string.
Return type BYTES
Output Returns a 512 bit (64-byte) hash value.

SHA3

Syntax
        
sha3(str)
      
Description Computes the cryptographic hash of the input STRING using the Secure Hash Algorithm 3 (SHA-3) algorithm.
Input parameter str: The input string.
Return type BYTES
Output Returns a 512 bit (64-byte) hash value.

Recommendation