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 MySQL | Ranking Functions The ranking functions in MySQL are used to rank each row of a partition. The ranking functions are also part of MySQL windows functions list. These functions are always used with OVER() clause.The ranking functions always assign rank on basis of ORDER BY clause.The rank is assigned to rows in a sequ 3 min read ORD() Function in MySQL ORD() function in MySQL is used to find the code of the leftmost character in a string . If the leftmost character is not a multibyte character, it returns ASCII value. And if the leftmost character of the string str is a multibyte character, ORD returns the code for that character, calculated from 3 min read MySQL | CONV( ) Function The MySQL CONV() function is used for converting a number from one numeric base system to another. The value returned by the CONV() function is in the form of a string value. It accepts three parameters which are the value to be converted, the current numeric base system and the numeric base system 2 min read STRCMP() Function in MySQL STRCMP() function in MySQL is used to compare two strings. If both of the strings are same then it returns 0, if the first argument is smaller than the second according to the defined order it returns -1 and it returns 1 when the second one is smaller the first one. Syntax : STRCMP(Str1, Str2) Param 3 min read UUID() function in MySQL In MySQL, the UUID() function is used to generate a Universal Unique Identifier (UUID), which is a 128-bit value that is globally unique. This function adheres to the RFC 4122 specification for creating universally unique identifiers. The generated UUID is especially useful for distributed systems, 6 min read Like