MD5 Node
AI-generatedOverview
The MD5 Node is designed to hash specified fields or array elements within your input data using the MD5 algorithm. It allows you to select individual values or entire arrays of objects and replace or set their values with their MD5 hashes. This node is useful in scenarios where you need to anonymize, obfuscate, or verify data by hashing sensitive information such as email addresses, user IDs, or other identifiers before further processing or storage.
Practical examples:
- Hashing user emails before exporting data to a third-party service.
- Obfuscating personal identifiers in logs or reports.
- Generating consistent hashes for deduplication or comparison purposes.
Properties
| Name | Meaning |
|---|---|
| Hash Single Fields. Capture the value using an expression and specify the fixed output path. |
Informational notice guiding how to use the "Fields to Hash" section. |
| Fields to Hash | Allows you to specify one or more single values to hash. Each entry requires: - Value: The value to be hashed (can use an expression). - Key: The output path where the hash will be stored. |
| Hash Arrays. Expects an array of objects. Specify the fixed path to the array, and a comma separated list of keys to hash. Is always done in-place. You can use empty brackets as wildcard to indicate arrays of arrays, for instance: level1[].level2[].level3 |
Informational notice about how to use the "Arrays to Hash" section. |
| Arrays to Hash | Allows you to specify one or more arrays to process. Each entry requires: - Path: Path to the array of objects. - Keys: Comma-separated list of keys within each object to hash. Supports nested arrays. |
Output
- The output is an array of items, each containing a
jsonfield. - For each input item:
- Any specified single fields are added or replaced at the given output paths with their MD5 hash.
- For arrays, the specified keys within each object in the array are replaced with their MD5 hash, in place.
- The structure of the output matches the input, except for the fields/keys that have been replaced with their MD5 hashes.
Example output:
{
"json": {
"emailHashed": "e13743a7f1db7f4246badd6fd6ff54ff",
"users": [
{ "id": "098f6bcd4621d373cade4e832627b4f6", "name": "John" },
{ "id": "ad0234829205b9033196ba818f7a872b", "name": "Jane" }
]
}
}
- No binary data is produced by this node.
Dependencies
- Uses the built-in Node.js
cryptomodule for MD5 hashing. - Relies on the
lodashlibrary for deep object manipulation. - No external API keys or services required.
- No special n8n configuration or environment variables needed.
Troubleshooting
Common issues:
- Incorrect path specification: If the output path or array path is incorrect, the hash may not be written where expected.
- Empty or missing values: If the value to hash is empty or undefined, no hash will be generated for that field.
- Invalid key names: Using invalid or non-existent keys in arrays will result in those fields not being hashed.
Error messages:
- If an error occurs and "Continue On Fail" is enabled, the item will include an
errorfield with details. - If "Continue On Fail" is not enabled, the node will throw an error and stop execution. Errors typically relate to invalid paths, missing values, or internal exceptions from the hashing process.
How to resolve:
- Double-check all field and array paths.
- Ensure that the values to be hashed exist and are accessible at runtime.
- Use expressions carefully to reference dynamic values.