MySQL | SHA1( ) Function Last Updated : 17 Feb, 2021 Comments Improve Suggest changes Like Article Like Report The MySQL SHA1() function is used for encrypting a string using the SHA-1 technique. The SHA1 stands for secure hash algorithm and it produces a 160-bit checksum for a user inputted string. The MySQL SHA1() function returns NULL if the string passed as an argument is a NULL string. The SHA1() function accepts one parameter which is the string to be encrypted. Syntax: SHA1(string) Parameters Used: string - It is used to specify the plain text string that is to be encrypted. Return Value: The SHA1() function in MySQL returns the encrypted string or NULL if the string passed is an empty string. Supported Versions of MySQL: MySQL 5.7MySQL 5.6MySQL 5.5MySQL 5.1MySQL 5.0MySQL 4.1 Example-1: Implementing SHA1() function on a string. SELECT SHA1('geeksforgeeks'); Output: 69c9a5c19c5c27e43cb0efc4c8644ed6d03a110b Example-2: Implementing SHA1() function on a string which has a combination of characters and integers. SELECT SHA1('geeksforgeeks123'); Output: 53ce00666cbef425ab8d06ed652095bea20a1616 Example-3: Implementing SHA1() function on a NULL string and returning the length of the string after compression. SELECT SHA1(NULL); Output: NULL Comment More infoAdvertise with us Next Article MySQL | SHA1( ) Function S Shubrodeep Banerjee Follow Improve Article Tags : SQL mysql SQLmysql Similar Reads MySQL | VERSION( ) Function The MySQL Version() function is used for returning the current version of the MySQL database. This function uses the utf8 character set. Generally, there is a suffix returned after the version number. The Version() function does not require any parameter to be passed. Syntax: VERSION() Parameters Us 1 min read MySQL IF( ) Function The MySQL IF() function is a control flow function that returns different values based on the result of a condition. IF() Function in MySQLThe IF() function in MySQL returns a value if the condition is TRUE and another value if the condition is FALSE. The MySQL IF() function can return values that c 2 min read MySQL | MD5 Function The MySQL MD5 function is used to return an MD5 128-bit checksum representation of a string. The MD5 message-digest algorithm is a widely used hash function producing a 128-bit hash value. The value returned by the MD5 function is a binary string of 32 hexadecimal digits, or NULL if the argument was 1 min read MySQL | PASSWORD Function The MySQL PASSWORD function is used for the generation of a hashed password using a plain-text password string It uses hashing techniques to generate the hashed password. This function is carried out by the authentication system. MySQL server uses the PASSWORD function to encrypt MySQL passwords for 1 min read UNHEX() Function in MySQL UNHEX() function in MySQL is used to convert the Hexadecimal number into the bytes represented by the Number. The value returned by it is a binary string. Syntax : UNHEX(str) Parameter : Required. str : It is a string which is to be converted into the byte represented by the number. Returns : It ret 1 min read Like