HEX(str), HEX(N)
A hexadecimal string is returened by HEX(), it is a representation of str for a string argument str, where each byte of each character in str is converted to two hexadecimal digits ans multibyte characters are converted more than two digits. The inverse of this operation is performed by the UNHEX() function.
HEX() returns a hexadecimal string representation for a numeric argument N and N treated as a long (BIGINT) number.
Here are some example of HEX fuunction-
mysql> SELECT HEX('hello world');
+------------------------+
| HEX('hello world') |
+------------------------+
| 68656C6C6F20776F726C64 |
+------------------------+
1 row in set (0.00 sec)
mysql> SELECT HEX(12345);
+------------+
| HEX(12345) |
+------------+
| 3039 |
+------------+
1 row in set (0.00 sec)
mysql> SELECT HEX(255);
+----------+
| HEX(255) |
+----------+
| FF |
+----------+
1 row in set (0.00 sec)
0 Comment(s)