Hash Functions

Hash functions are used to encode data in blocks, where the entire output of the function can be drastically changed by the smallest change in the input. These functions generally generate a fixed-length output, independant of the size of the string used as input.

Hashing is a one-way operation: it can encode data, but decoding is not always possible. This allows you to confirm information with a message when the recipient already has it, but it is not meaningful to anyone without that information.

In CrossEngage, we can use the md5 and sha256 helper functions to encode text, using the hashing algorithms of the same name.

Example

To encode a User's email address with a md5 or sha256, you can use one of the following lines of code:

{{#md5}{{user.[traits.email]}}{{/md5}}
{{#sha256}}{{user.[traits.email]}}{{/sha256}}

Last updated