Hash File icon

Hash File

Calculate the hash of a file

Overview

This node calculates the cryptographic hash of a binary file input using various supported hashing algorithms. It is useful for verifying data integrity, generating unique identifiers for files, or securely storing file fingerprints. For example, you can use it to generate a RIPEMD160 hash of an uploaded document to ensure it has not been altered or to create a consistent checksum for file comparison.

Properties

Name Meaning
Input Binary Field The name of the input binary field containing the file data to be hashed (default: "data")
Output Hash Field The name of the output JSON field where the resulting hash string will be stored (default: "hash")

The node also supports selecting the hash algorithm via the "Hash Algorithm" property with options including SHA-256, MD5, SHA-1, SHA-512, SHA-384, RIPEMD160, and WHIRLPOOL. In this case, the operation is fixed to RIPEMD160.

Output

The node outputs the original JSON data merged with a new field containing the computed hash string in hexadecimal format. The field name corresponds to the configured "Output Hash Field". The binary data remains unchanged and is passed through as-is.

Example output JSON snippet:

{
  "originalField1": "value1",
  "hash": "a3f1c5e6d7b8..."
}

No binary output is generated or modified by this node beyond passing the input binary data forward.

Dependencies

  • Uses Node.js built-in crypto module for hashing.
  • Requires the input data to contain a binary field with valid file content.
  • No external API keys or services are needed.

Troubleshooting

  • Missing binary data: If the specified input binary field does not exist or contains no data, the node will fail to compute the hash. Ensure the correct binary field name is provided.
  • Unsupported hash algorithm: Although multiple algorithms are supported, specifying an unsupported one will cause an error. Use only the listed options.
  • Large files: Processing very large binary files may impact performance or memory usage.
  • Error messages typically relate to missing binary data or invalid parameters; verify configuration and input data structure.

Links and References

Discussion