ENCODE

2023-12-25 08:49:42  Updated

Syntax

ENCODE(str,pass_str)

Purpose

ENCODE() uses the pass_str password to encrypt the string. This function returns a binary string with the same length as the str string. To decrypt the returned result, call the DECODE() function.

Examples

Use the ENCODE() function with a salt value to reduce risks.

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

Contact Us