sha1_hex(8) DB2 User Defined Function and Stored Procedure sha1_hex(8)
NAME
sha1_hex - DB2 UDF and SP to generate an SHA1 40-character hexadecimal
hash
SYNOPSIS
>>-SHA1_HEX--(--expression--)--------------------------------><
>>-SHA1_HEX--(--expression--,--hash--)-----------------------><
DESCRIPTION
SHA1 algorithm. The sha1_hex routine returns a 40-character hexadecimal
hash.
The argument can be a character string that is either a CHAR or VARCHAR
not exceeding 4096 bytes.
The result of the function is CHAR(40). The result can be null; if the
argument is null, the result is the null value.
EXAMPLES
Example 1:
Inserting the user test and the sha1 crypted clear text testpwd to the
table users.
INSERT INTO USERS (username, password)
VALUES ('test', sha1_hex('testpwd'))
Example 2:
SELECT sha1_hex('testpwd') FROM SYSIBM.SYSDUMMY1
1
----------------------------------------
98ef0758e6aac6f9a9e1197548c8190b72c9581d
1 record(s) selected.
Example 3:
CALL sha1_hex('testpwd', ?)
Value of output parameters
--------------------------
Parameter Name : HASH
Parameter Value : 98ef0758e6aac6f9a9e1197548c8190b72c9581d
Return Status = 0
AUTHOR
Written by Helmut K. C. Tessarek.
BUGS
Hopefully none :-) But if you find one, please report it at:
https://github.com/tessus/db2-hash-routines/issues
WEB SITE
http://tessus.github.io/db2-hash-routines
sha1_hex August 2017 sha1_hex(8)