MD5()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the MD5 checksum for the given string argument.
USAGE
MD5(string)
Argument Name | Description |
---|---|
| The input string |
DETAILS
MD5()
is a cryptographic hash function that returns the MD5 checksum for a string argument.
The 128-bit hash value is returned as a string of 32 hexadecimal digits.
A NULL
is returned if the argument is NULL
.
EXAMPLES
SELECT MD5('hello');
+----------------------------------+
| MD5('hello') |
+----------------------------------+
| 5d41402abc4b2a76b9719d911017c592 |
+----------------------------------+
CREATE TABLE md5_example (
chksum BINARY(16)
);
INSERT INTO md5_example VALUES
(UNHEX(MD5('first'))),
(UNHEX(MD5('second')));
SELECT HEX(chksum)
FROM md5_example;
+----------------------------------+
| HEX(chksum) |
+----------------------------------+
| 8B04D5E3775D298E78455EFC5CA404D5 |
| A9F0E61A137D86AA9DB53465E0801612 |
+----------------------------------+