ID EN
Encryption and Compression Functions

SHA1(str)

MySQL 8.4 🇮🇩 Bahasa Indonesia

SHA1(str), SHA(str)

Syntax

MYSQL
SELECT SHA1('abc');
'a9993e364706816aba3e25717850c26c9cd0d89d'

Contoh

Example

Calculates an SHA-1 160-bit checksum for the string, as described in RFC 3174 (Secure Hash Algorithm). The value is returned as a string of 40 hexadecimal digits, or NULL if the argument is NULL. One of the possible uses for this function is as a hash key. See the notes at the beginning of this section about storing hash values efficiently. SHA() is synonymous with SHA1().

MYSQL
SELECT SHA1('abc');
'a9993e364706816aba3e25717850c26c9cd0d89d'