sha256_hex(8)   DB2 User Defined Function and Stored Procedure   sha256_hex(8)




NAME

       sha256_hex - DB2 UDF and SP to generate an SHA256 64-character hexadec-
       imal hash


SYNOPSIS

       >>-SHA256_HEX--(--expression--)--------------------------------><

       >>-SHA256_HEX--(--expression--,--hash--)-----------------------><


DESCRIPTION

       SHA256 algorithm. The sha256_hex routine returns a  64-character  hexa-
       decimal 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(64). 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 sha256 crypted clear text testpwd to
       the table users.

       INSERT INTO USERS (username, password)
         VALUES ('test', sha256_hex('testpwd'))

       Example 2:

       SELECT sha256_hex('testpwd') FROM SYSIBM.SYSDUMMY1

       1
       ----------------------------------------------------------------
       a85b6a20813c31a8b1b3f3618da796271c9aa293b3f809873053b21aec501087

         1 record(s) selected.

       Example 3:

       CALL sha256_hex('testpwd', ?)

         Value of output parameters
         --------------------------
         Parameter Name  : HASH
         Parameter Value : a85b6a20813c31a8b1b3f3618da796271c9aa293b3f809873053b21aec501087

         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



sha256_hex                         May 2017                      sha256_hex(8)