On this page
Sommatic Docs
Open portal

Hash Data

Hashes data with SHA-256, SHA-384 or SHA-512 (hex).

View as Markdown
Open in
Identity Available crypto.hash Version 2.0.0 Execution: sync

Computes the hexadecimal SHA-256, SHA-384 or SHA-512 digest of a value. Strings are hashed as UTF-8; any other value is JSON-serialized first.

How it works

  1. Resolves the config; use a pure expression such as {{ $json.email }} in data.
  2. Leaves through error with data is required when data is undefined, null or an empty string.
  3. Checks algorithm (default sha256) against sha256, sha384 and sha512.
  4. Serializes non-string values with JSON.stringify and digests the UTF-8 text.
  5. Returns { hash } (lowercase hex) on out, with meta.crypto.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-hash-email",
  "label": "Hash customer email",
  "operator_slug": "crypto.hash",
  "operator_version": "2.0.0",
  "config": {
    "data": "{{ $json.email }}",
    "algorithm": "sha256"
  }
}

Configuration

data any Required

Data to hash (objects are JSON-serialized)

algorithm string Optional

Default: sha256

Allowed values: sha256sha384sha512

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

data
Objects are serialized with JSON.stringify, so key order matters: {"a":1,"b":2} and {"b":2,"a":1} give different hashes. Normalize the value first when you compare hashes across systems.

Output ports

out default

The digest was computed.

Data
{
  "hash": "8c87b489ce35cf2e2f39f80e282cb2e804932a56a213983eeeb428407d43b52d"
}
error

data is missing or the algorithm is not supported.

Data
{
  "error": "Unsupported hash algorithm: md5"
}

In expressions

What a later node can read from this node's output with $("Hash Data").item.json.<path> (write your node's label instead of Hash Data). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.

ExpressionEditorWorker
$("Hash Data").item.json.hashstring= "8c87b489ce35cf2e2f39f80e282cb2e804932a56a213…"

Errors

Message Port Cause and fix
data is required error data is empty or its expression resolved to nothing. 0 and false are valid values.
Unsupported hash algorithm: <algorithm> error Only sha256, sha384 and sha512 are accepted.

Input contract

data any Required
algorithm string Optional

Output contract

hash string Optional

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "crypto.hash",
  "name": "Hash Data",
  "category": "identity",
  "version": "2.0.0",
  "description": "Hashes data with SHA-256, SHA-384 or SHA-512 (hex).",
  "capabilities": [
    "crypto",
    "hash"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "data": {
        "description": "Data to hash (objects are JSON-serialized)"
      },
      "algorithm": {
        "type": "string",
        "default": "sha256",
        "enum": [
          "sha256",
          "sha384",
          "sha512"
        ]
      }
    },
    "required": [
      "data"
    ]
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "data": {},
      "algorithm": {
        "type": "string"
      }
    },
    "required": [
      "data"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "hash": {
        "type": "string"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Hash",
      "description": "Hashed string",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Hash failed",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "sync",
  "required_resources": [],
  "compatible_worker_pools": [
    "standard"
  ],
  "tags": [
    "crypto",
    "security"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_veripass",
    "profile": {
      "name": "Veripass",
      "verified": true,
      "url": "https://me.veripass.com/veripass",
      "logo_url": null
    }
  }
}

Execution

Execution
sync
Stateful
No
Capabilities
cryptohash
Tags
cryptosecurity

Notes and limits

  • The digest is unkeyed: the same input always gives the same hash, which makes it suitable for equality checks and pseudonymous keys.
  • Leaving through error does not fail the run: the engine follows the edges wired to error, and if there are none the branch simply ends.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs