Actions109
- Activity Actions
- Assets Actions
- Authentication Actions
- Collections Actions
- Extensions Actions
- Fields Actions
- Files Actions
- Folders Actions
- Items Actions
- Permissions Actions
- Presets Actions
- Relations Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
- Webhooks Actions
Utilities → Generate Hash
AI-generatedOverview
The "Generate Hash" operation under the "Utilities" resource in this custom n8n node allows you to generate a cryptographic hash from a given input string using the Directus API. This is useful for scenarios where you need to securely store, compare, or verify sensitive data such as passwords, tokens, or any other information that should not be stored in plain text.
Practical examples:
- Storing user passwords as hashes instead of plain text.
- Generating unique identifiers or checksums for files or data.
- Verifying data integrity by comparing hashes.
Properties
| Name | Type | Meaning |
|---|---|---|
| String | String | The input string to be hashed. This is the value that will be sent to the Directus API to generate its hash. |
Output
The output will be an object with a json field containing the result of the hash generation. The structure is as follows:
{
"result": "<generated_hash_string>"
}
- If the response from the API is a simple string, number, or boolean, it will be wrapped in a
resultproperty. - In case of errors (and if "Continue On Fail" is enabled), the output will contain an
errorproperty with the error message.
Dependencies
- Directus API: Requires access to a running Directus instance with the appropriate endpoint enabled.
- API Credentials: You must configure the
directusApicredentials in n8n for authentication.
Troubleshooting
Common issues:
- Missing or invalid credentials: Ensure your Directus API credentials are correctly set up in n8n.
- Empty or invalid input string: The "String" property is required; leaving it empty will cause an error.
- API connectivity issues: Network problems or incorrect API URLs can prevent successful requests.
Error messages and resolutions:
"Cannot read property 'message' of undefined": Likely due to missing or malformed input. Double-check the "String" property."401 Unauthorized": Check your API credentials."404 Not Found": The Directus instance may not have the hashing utility enabled or the endpoint URL is incorrect.