MD5
→ stringReturns an MD5 hash for a given string value. Optionally specify the character set used to evaluate the string.
Available in:
Email
CloudPage
Automation
Triggered Send
Syntax
Platform.Function.MD5(string[, charset])
1–2 arguments
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string |
string | Yes | String to evaluate |
charset |
string | No | Character set to use when evaluating the string, such as ASCII or UTF-8 |
Description
Returns an MD5 hash of the given input string. Use the optional charset parameter when the input string contains characters outside ASCII range.
MD5 is a one-way hash, not encryption. Do not use it to store passwords or protect sensitive data.
Examples
Hash a value from a Data Extension
var normalStr = Platform.Function.Lookup("ForMD5Info", "HashData", "HashKey", "stringValue");
var hashedStr = Platform.Function.MD5(normalStr);
Write(hashedStr);
Hash with explicit character set
var hashedStr = Platform.Function.MD5("Hello World", "UTF-8");
Write(hashedStr); // "b10a8db164e0754105b7a99be72e3fe5"