Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026.
We will start enforcing it in phases. For more information on the details of Python end of life
and migration options, see the
blog post
SHA1 function
The SHA1 function uses the SHA1 cryptographic hash function to convert a variable-length string into a 40-character string that is a text representation of the hexadecimal value of a 160-bit checksum.
Syntax
SHA1 is a synonym of SHA function and FUNC_SHA1 function.
SHA1(string)
Arguments
- string
-
A variable-length string.
Return type
The SHA1 function returns a 40-character string that is a text representation of the hexadecimal value of a 160-bit checksum.
Example
The following example returns the 160-bit value for the word 'Amazon Redshift':
select sha1('Amazon Redshift');