Function Updated 17 Oct 2026
md5(text)
Returns the MD5 hash of the text as 32 upper-case hexadecimal characters. The text is encoded as UTF-8, numbers are converted the JavaScript way ("18.2"), and null or undefined is hashed as empty text.
MD5 is not secure: never use it for passwords. For passwords use a salted, slow hash such as PBKDF2 (crypto.subtle.deriveBits).
Parameters
textstringrequiredText to create hash for.
Returns
Upper-case hexadecimal string. null if not called with exactly one argument.
Example
Mixed HTML (or any text file) with inline JavaScript between hash signs.
#{
let x = "test";
write(docly.md5(x));
}#The template above produces this output:
098F6BCD4621D373CADE4E832627B4F6