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.

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"

See Also