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
Name | Type | Description | Required |
---|---|---|---|
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
Type | Description |
---|---|
string | The generated hash string. |
Example
Last updated