Handlebars Helper Function: md5
Converts a string to a 128-bit hexadecimal MD5 hash.
This helper is available in the Winter ’27 release of Marketing Cloud Next.
| Parameter | Type | Description |
|---|---|---|
STRING_TO_CONVERT | String | Required. The string to hash. |
charset | String | The character set to use. Specify as a named parameter. Accepted values are UTF-8 and UTF-16. The default is UTF-8. |
The function returns the 128-bit MD5 hash as a hexadecimal string.
This example hashes a string of text so that the plain-text value isn’t stored or transmitted directly.
The function returns this MD5 hash:
This example hashes the same string, but specifies UTF-16 encoding.
Because the character encoding changes the bytes that are hashed, the function returns a different hash:
MD5 is a one-way hash and isn’t suitable for securely storing passwords or other sensitive data.