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




NAME

       apr_sha256 - DB2 UDF and SP to generate an SHA256 hash


SYNOPSIS

       >>-APR_SHA256--(--expression--)--------------------------------><

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


DESCRIPTION

       SHA256   algorithm.  The  apr_sha256  routine  returns  the  identifier
       {SHA256} plus the base64 encoded sha256 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(52). 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', apr_sha256('testpwd'))

       Example 2:

       SELECT apr_sha256('testpwd') FROM SYSIBM.SYSDUMMY1

       1
       ----------------------------------------------------
       {SHA256}qFtqIIE8Maixs/NhjaeWJxyaopOz+AmHMFOyGuxQEIc=

         1 record(s) selected.

       Example 3:

       CALL apr_sha256('testpwd', ?)

         Value of output parameters
         --------------------------
         Parameter Name  : HASH
         Parameter Value : {SHA256}qFtqIIE8Maixs/NhjaeWJxyaopOz+AmHMFOyGuxQEIc=

         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



apr_sha256                         June 2015                     apr_sha256(8)