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




NAME

       sha256 - DB2 UDF and SP to generate an SHA256 hash


SYNOPSIS

       >>-SHA256--(--expression--)------------------------------------><

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


DESCRIPTION

       SHA256  algorithm. The sha256 routine returns a glibc2's crypt hash. If
       the system's crypt does not  support  sha-256,  an  SQLSTATE  39702  is
       returned.

       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(55). 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('testpwd'))

       Example 2:

       SELECT sha256('testpwd') FROM SYSIBM.SYSDUMMY1

       1
       -------------------------------------------------------
       $5$S.LqPR7Z$273zPncMdmJ0dE1WdLldWVBmaHSDUDl8/tW8At8Hc0A

         1 record(s) selected.

       Example 3:

       CALL sha256('testpwd', ?)

         Value of output parameters
         --------------------------
         Parameter Name  : HASH
         Parameter Value : $5$vSDCZr2d$rfh.aDopE5l3lm26AwwcIYnuVdV7/9QBACWukqYyV3/

         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                             July 2016                         sha256(8)