Overview

The Hash Block calculates the MD5 or SHA hash of incoming data. This block is particularly useful for performing equivalency comparisons, data integrity checks, or generating unique identifiers based on content.

Key Features

  • Support for multiple hash algorithms (MD5, SHA-1, SHA-256, SHA-512)
  • Converts input to string before hashing
  • Outputs hash value as a string

Inputs

input
string
required

The data to be hashed. Required. Non-string inputs will be coerced to strings.

Outputs

hash
string

The calculated hash value of the input data.

Editor Settings

algorithm
string
default:"sha256"

The hash algorithm to use. Options:

  • md5: MD5 algorithm
  • sha1: SHA-1 algorithm
  • sha256: SHA-256 algorithm
  • sha512: SHA-512 algorithm

Example: Generating a Hash for Data Comparison

  1. Create a Text Block with some sample data, e.g., “Hello, World!”.
  2. Add a Hash Block and connect the Text Block’s output to its input.
  3. Configure the Hash Block to use SHA-256 algorithm.
  4. Run the flow to see the generated hash value.

Error Handling

  • If the input is undefined or null, the block will error
  • Invalid algorithm selections will result in an error

FAQ

See Also