跳转到内容
Agentic Workflowdocs
v0.8.2免费安装

节点 / builtin / datatransformation

Crypto

Hash, HMAC and generate random values with WebCrypto

数据 扩展程序网页应用

此内容尚不支持你的语言。

Hash or sign text, or generate random values and UUIDs, right in the browser.

Crypto runs once per incoming item and puts its result in Put Result In Field (result by default). It has four operations:

  • Hash turns text into a fingerprint with SHA-1, SHA-256, SHA-512 or MD5. The same text always gives the same hash.
  • HMAC signs text with a secret key taken from a saved credential, using SHA-1, SHA-256 or SHA-512.
  • Random bytes generates random bytes, 32 by default and at most 1024.
  • UUID v4 generates a random unique id such as 3f2b8c1e-….

Hashes, signatures and random bytes come out as lowercase hex or base64 text, depending on Encoding.

  • Fingerprint scraped content so you can tell later whether it changed.
  • Sign a payload with HMAC before you send it to an API or webhook that checks signatures.
  • Create an idempotency key or a random id for each outgoing item.
  • Use MD5 only when another system expects an MD5 checksum. It is not safe for security purposes.
设置项类型作用
Operation ChoiceWhat to do. Options: Hash, HMAC, Random bytes, UUID v4. 默认值:Hash
Algorithm ChoiceThe digest algorithm, for Hash and HMAC. Options: SHA-1, SHA-256, SHA-512, MD5. 默认值:SHA-256
HMAC Key CredentialCredential holding the secret key, for HMAC.
Text ValueThe text to hash or HMAC.
Source Field TextField holding the text, when the field above is left empty.
Byte Length NumberHow many random bytes to generate. 默认值:32
Encoding ChoiceHow the result bytes are presented as text. Options: Hex, Base64. 默认值:Hex
Include Input Fields ToggleKeep the incoming item’s fields alongside the result. 默认值:On
Put Result In Field TextField holding the hash, HMAC, random bytes or UUID. 默认值:result
  • For Hash and HMAC, the node reads the text from Text first, for example {{ $input.body }}. If Text is empty, it reads the field named in Source Field (dots work for nested fields).
  • Byte Length only matters for Random bytes. Values above 1024 are reduced to 1024.
  • Output

Each item comes out with the result as text in Put Result In Field, next to its original fields. Turn off Include Input Fields to output only the result. Use it downstream with {{ $input.result }}.

Only HMAC needs a credential. Save the shared secret as a token credential (API Token / Bearer) and pick it in HMAC Key; see Create a credential. The secret stays in your credential store, so it is not included when you export or share the workflow.

  1. Edit Fields builds the payload text in a field named body.
  2. Crypto with Operation HMAC, Algorithm SHA-256, HMAC Key set to your saved secret, Text {{ $input.body }} and Encoding Hex.
  3. Http Request sends body and adds a signature header with the value {{ $input.result }}.
  • “HMAC requires a credential holding the secret key. Select one in the HMAC Key field.” Pick or create a credential in HMAC Key.
  • “MD5 is not a valid HMAC algorithm. Choose SHA-1, SHA-256, or SHA-512.” MD5 works for Hash only. Change Algorithm.
  • “No text to hash. Fill in the Text field, or name the field holding it.” Both Text and Source Field are empty.
  • “Field “…” does not exist on the incoming item.“ The name in Source Field is wrong or the field is empty. Check its spelling against the previous node’s output.
  • The signature does not match what the other service expects. Check that both sides use the same algorithm and encoding (hex vs base64), and that you sign exactly the same text, including spaces and line breaks.
编辑此页

最近更新:

Was this page useful?
向 Aria 询问“Crypto”