Documentation

gwp_hash


The `gwp_hash` modifier can be used to generate a hash of a field value with a specified algorithm and an optional salt. This can be useful for comparing data while hiding the actual value.
It is not recommended to use this feature for security purposes.

How to use

To utilize the `gwp_hash` modifier, you include it in your merge tag like this:

{YourField:1:gwp_hash algorithm="sha256" salt=""}

Parameters


algorithm: The hashing algorithm you wish to use. The default value is `sha256`, but you can specify any algorithm supported by your PHP installation’s `hash_algos()` function. If an unavailable hashing algorithm is specified, an error will be logged, and the original value will be returned.
salt: An optional salt value that can be appended to the data. This parameter supports nested merge tags for dynamic content.

Examples

If you have a field with ID 3 and want to hash its value using the `sha512` algorithm with a salt, you could write:

{FieldName:3:gwp_hash algorithm="md5" salt="*|AnotherField:4|*"}

This would generate a hash of the value in Field 3, using the MD5 algorithm and the value from Field 4 as a salt.

Advanced Merge Tagsv1.8.3

To use the functionalities described in this documentation, you'll need to get the GravityWP - Advanced Merge Tags add-on.

Read more