Skip to main content

Hash

SHA-256/384/512 digest of a string, rendered as hex, base64 or base64url. Works in the browser and in a cloud function.

Hash takes the text on Value, hashes it with the chosen SHA-2 algorithm and puts the digest on Digest. It runs on WebCrypto, which both runtimes already have — there is no dependency behind it. The digest is computed asynchronously, so Done fires from a later turn than the Do that started it: wire Done, never assume Digest is fresh in the same frame. MD5 and SHA-1 are deliberately not offered; WebCrypto implements neither for digesting, and hand-rolling one would be shipping a broken hash. If you need a keyed digest, that is the HMAC node, which is cloud-only because it takes a secret.

When to use it

Content addressing, a cache key, an integrity check, or comparing a value against a digest somebody else published. Not for storing passwords — a plain SHA-2 is the wrong tool for that, whichever runtime you are in.

At a glance

CategoryUtilities
Type namenet.noodl.Hash
Available inbrowser, cloud
SSR compatibilitysafe
Provided bynoodl-runtime

Inputs

Values

NameTypeDefaultDescription
algorithmEnum (SHA-256, SHA-384, SHA-512)SHA-256Which SHA-2 digest to compute. MD5 and SHA-1 are not offered — WebCrypto has neither
encodingEnum (hex, base64, base64url)hexHow the digest bytes are rendered as text
valueStringThe text to hash, as UTF-8 bytes

Signals

NameTypeDefaultDescription
hashSignalComputes the digest of Value

Outputs

Values

NameTypeDefaultDescription
digestStringThe hash of Value, rendered in Encoding. Available once Done has fired

Signals

NameTypeDefaultDescription
completedSignalFires after every invocation, whatever the outcome — wire this to carry on regardless. Failure still fires and still carries its reason, so this cannot hide an error
doneSignalFires once the digest has been computed and is available on Digest

Failure outputs

NameTypeDefaultDescription
errorStringWhy the digest could not be computed
failureSignalFires when the digest could not be computed, most often because WebCrypto is not available here

Patterns

  • Do → Done → the node that consumes Digest. The digest is asynchronous, so a wire off Done is the only way to sequence it correctly.

Watch out for

  • Reading Digest immediately after pulsing Do, in the same frame. It is still the previous value.
  • Hashing a password with this node. Use your backend's password flow; a bare SHA-2 is not a password hash.

HMAC, Random Bytes, UUID

Generated

This page is generated from node-catalog-enriched.json. Do not edit it by hand — run npm run docs:nodes to regenerate, and fix the source enrichment instead.