Syntax

MD5(str)

Description

MD5 is no longer considered cryptographically secure, and should not be used for password encryption.

Calculates an MD5 128-bit checksum for the string.

The return value is a 32-hex digit string, and as of MariaDB 5.5, is a nonbinary string in the connection character set and collation, determined by the values of the character_set_connection and collation_connection system variables. Before 5.5, the return value was a binary string.

NULL is returned if the argument was NULL.

The return value can, for example, be used as a hash key, but MD5 is no longer considered cryptographically secure, and should not be used for password encryption. Consider a more secure algorithm, such as SHA2().

Examples

SELECT MD5('testing');
+----------------------------------+
| MD5('testing')                   |
+----------------------------------+
| ae2b1fca515949e5d54fb22b8ed95575 |
+----------------------------------+

Comments

Comments loading...