Syntax:
SHA1(str), SHA(str)

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 hex digits, or NULL if the argument was 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. You can also use
SHA1() as a cryptographic function for storing passwords. SHA() is
synonymous with SHA1().

As of MySQL 5.5.3, the return value is a nonbinary string in the
connection character set. Before 5.5.3, the return value is a binary
string; see the notes at the beginning of this section about using the
value as a nonbinary string.

URL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html

