hash_string

Generates a hash from a given string, with an optional parameter to specify the maximum length of the hash. By default, the full hash is returned, but it can be truncated to the specified length if provided.

Arguments

NameTypeDescriptionRequired

input_string

string

The string to be hashed. Can be anything

max_length

number

Optional maximum length of the hash. If defined, the output hash will be truncated to this length.

Returns

TypeDescription

string

The generated hash string.

Example

- name: hash_string
  arguments:
    input_string: 'Hello, World!'
    max_length: 10
  returns: 'fc3ff98e8c'

Last updated