|
1 | | -.TH sha512 "8" "July 2016" "sha512" "DB2 User Defined Function and Stored Procedure" |
| 1 | +.TH sha512 "8" "May 2017" "sha512" "DB2 User Defined Function and Stored Procedure" |
2 | 2 | .SH NAME |
3 | 3 | sha512 \- DB2 UDF and SP to generate an SHA512 hash |
4 | 4 | .SH SYNOPSIS |
5 | | ->>-SHA512--(--expression--)------------------------------------>< |
| 5 | +.nf |
| 6 | +>>-SHA512--(--expression--+---------+--)----------------------->< |
| 7 | + '-,--salt-' |
| 8 | +.fi |
6 | 9 | .PP |
7 | | ->>-SHA512--(--expression--,--hash--)--------------------------->< |
| 10 | +.nf |
| 11 | +>>-SHA512--(--expression--+---------+--,--hash--)-------------->< |
| 12 | + '-,--salt-' |
| 13 | +.fi |
8 | 14 | .SH DESCRIPTION |
9 | 15 | SHA512 algorithm. The sha512 routine returns a glibc2's crypt hash. If the system's crypt does not support sha-512, |
10 | 16 | an SQLSTATE 39702 is returned. |
11 | 17 | .PP |
12 | 18 | The argument can be a character string that is either a CHAR or VARCHAR not exceeding 4096 bytes. |
| 19 | +An optional salt can be specified, which must be a eight-character string chosen from the set [a\(enzA\(enZ0\(en9./]. If the salt is not exactly eight characters long, an SQLSTATE 39703 is returned. If the salt contains invalid characters, an SQLSTATE 39704 is returned. |
13 | 20 | .PP |
14 | | -The result of the function is CHAR(98). The result can be null; if the argument is null, the result is the null value. |
| 21 | +The result of the function is CHAR(98). The result can be null; if one the arguments is null, the result is the null value. |
15 | 22 | .SH EXAMPLES |
16 | 23 | \fBExample 1:\fR |
17 | 24 |
|
@@ -49,6 +56,33 @@ CALL sha512('testpwd', ?) |
49 | 56 |
|
50 | 57 | Return Status = 0 |
51 | 58 | .fi |
| 59 | +.PP |
| 60 | +\fBExample 4:\fR |
| 61 | + |
| 62 | +.br |
| 63 | +.nf |
| 64 | +SELECT sha512('testpwd', '12345678') FROM SYSIBM.SYSDUMMY1 |
| 65 | + |
| 66 | +1 |
| 67 | +-------------------------------------------------------------------------------------------------- |
| 68 | +$6$12345678$tlHrypdWTz6FqubBpgL/ePlxr4lZuQ8OK1zfV6zWUmGJSz.5kGWwQGjg69Qm1Bm3.DvILruqA61o3EHsxSoko1 |
| 69 | + |
| 70 | + 1 record(s) selected. |
| 71 | +.fi |
| 72 | +.PP |
| 73 | +\fBExample 5:\fR |
| 74 | + |
| 75 | +.br |
| 76 | +.nf |
| 77 | +CALL sha512('testpwd', '12345678', ?) |
| 78 | + |
| 79 | + Value of output parameters |
| 80 | + -------------------------- |
| 81 | + Parameter Name : HASH |
| 82 | + Parameter Value : $6$12345678$tlHrypdWTz6FqubBpgL/ePlxr4lZuQ8OK1zfV6zWUmGJSz.5kGWwQGjg69Qm1Bm3.DvILruqA61o3EHsxSoko1 |
| 83 | + |
| 84 | + Return Status = 0 |
| 85 | +.fi |
52 | 86 | .SH AUTHOR |
53 | 87 | Written by Helmut K. C. Tessarek. |
54 | 88 | .SH "BUGS" |
|
0 commit comments