Skip to main content
Version: V1.0.0

ENCODE

Syntax

ENCODE(str,pass_str)

Description

ENCODE() uses pass_str to encrypt the string. The result is a binary string of the same length as str. To decrypt the result, use DECODE().

Examples

When using ENCODE(), you must use a salt value to reduce the risk.

SELECT ENCODE('text', CONCAT('ob_random_salt','ob_secret_password'))
+---------------------------------------------------------------+
| ENCODE('text', CONCAT('ob_random_salt','ob_secret_password')) |
+---------------------------------------------------------------+
5+ |
+---------------------------------------------------------------+
1 row in set (0.001 sec)