Skip to main content

Hash Node

Hash Node Screenshot

Overview

The Hash Node computes a hash of the input value using the configured hash function. It supports MD5, SHA-1, SHA-256, and SHA-512 hash algorithms. This node can be useful for generating unique IDs, checksums, and other purposes.

Inputs

TitleData TypeDescriptionDefault ValueNotes
InputstringThe string to be hashed.(required)The input will be coerced into a string if it is not a string.

Example 1: Hash a string

  1. Create a Text Node and set the value to Hello, World!.
  2. Create a Hash Node and connect the Text Node to its Input port.
  3. Run the graph. The Hash output of the Hash Node should contain the hash of the string Hello, World!.

Hash Node Example 1

Error Handling

The Hash Node will error if the Input is not provided or if an unsupported hash algorithm is specified.

FAQ

Q: Can I use the Hash Node to hash a number or other non-string value?

A: Yes, you can. The Hash Node will automatically convert non-string inputs into strings before hashing them.

Q: Can I use the Hash Node to hash a password?

A: It is not recommended to have passwords in Rivet. If you need to hash a password, you should do so outside of Rivet.

Q: Can I use the Hash Node to generate a unique ID for a piece of data?

A: Yes, you can use the Hash Node to generate a unique repeatable ID for a piece of data by hashing the data. This can be used with the Vector Store Node to store the data in a vector store with the ID as the key.

See Also