{md5:text}

Description

Returns the MD5 hash of text as a 32-character lowercase hexadecimal string - the AA counterpart of PHP hash('md5', ...). MD5 is a one-way fingerprint, not encryption: you cannot get the original text back from the hash, and the same input always produces the same 32 hex characters. The input is not trimmed, so leading and trailing spaces change the result. Empty input is valid and hashes to d41d8cd98f00b204e9800998ecf8427e. Typical uses are cache keys, deduplication keys, and compact opaque tokens (often nested, e.g. base64 of a packed md5, then cut short with substr). Do NOT use md5 to store passwords - it is cryptographically weak and AA has pwdcrypt for password hashing. This command only computes the hash; there is no inverse.

Parameters

text optional default (empty string)

The string to hash. It is not trimmed, so leading and trailing spaces are part of what gets hashed. Any value is allowed, including an empty string, which hashes to d41d8cd98f00b204e9800998ecf8427e.

Examples

test{md5:hello}
Expected5d41402abc4b2a76b9719d911017c592
Actual5d41402abc4b2a76b9719d911017c592
The everyday case: pass a string, get its 32-character lowercase hex MD5 hash.
test{md5:Hello, World!}
Expected65a8e27d8879283831b664bd8b7f0ad4
Actual65a8e27d8879283831b664bd8b7f0ad4
The hash depends on every character, including case and punctuation. Hello, World! hashes differently from hello.
test{md5:user@example.org}
Expected572c3489ea700045927076136a969e27
Actual572c3489ea700045927076136a969e27
A common use: turn an identifier such as an email address into a fixed-length, opaque key for caching or deduplication. The same email always yields the same hash.
test[{md5:}]
Expected[d41d8cd98f00b204e9800998ecf8427e]
Actual[d41d8cd98f00b204e9800998ecf8427e]
Empty input is allowed and hashes to a fixed value. The brackets show the output is always exactly 32 characters, never empty.
test{md5: hello}
Expected6e2dbc548e9a58678bb6adebb6848e91
Actual6e2dbc548e9a58678bb6adebb6848e91
The input is not trimmed. Two leading spaces are part of what gets hashed, so this differs from md5 of hello. Trim the value yourself first if you want spaces ignored.
test{strlen:{md5:any text}}
Expected32
Actual32
Whatever the input, the hash is always 32 hexadecimal characters long. Useful when you size a column or a token.
test{substr:{md5:session-key-7f3a}:0:8}
Expectede7c437be
Actuale7c437be
Hash a value, then cut the first characters with substr to make a compact token. Eight hex characters are enough to be unguessable for a cache or share link, though shorter slices raise the chance of collisions.