Skip to content

Commit f06c764

Browse files
committed
update sha256 and sha512 man pages to include optional salt
[ci skip]
1 parent 5385b56 commit f06c764

File tree

2 files changed

+76
-8
lines changed

2 files changed

+76
-8
lines changed

man/man8/sha256.8

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
.TH sha256 "8" "July 2016" "sha256" "DB2 User Defined Function and Stored Procedure"
1+
.TH sha256 "8" "May 2017" "sha256" "DB2 User Defined Function and Stored Procedure"
22
.SH NAME
33
sha256 \- DB2 UDF and SP to generate an SHA256 hash
44
.SH SYNOPSIS
5-
>>-SHA256--(--expression--)------------------------------------><
5+
.nf
6+
>>-SHA256--(--expression--+---------+--)-----------------------><
7+
'-,--salt-'
8+
.fi
69
.PP
7-
>>-SHA256--(--expression--,--hash--)---------------------------><
10+
.nf
11+
>>-SHA256--(--expression--+---------+--,--hash--)--------------><
12+
'-,--salt-'
13+
.fi
814
.SH DESCRIPTION
915
SHA256 algorithm. The sha256 routine returns a glibc2's crypt hash. If the system's crypt does not support sha-256,
1016
an SQLSTATE 39702 is returned.
1117
.PP
1218
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.
1320
.PP
14-
The result of the function is CHAR(55). The result can be null; if the argument is null, the result is the null value.
21+
The result of the function is CHAR(55). The result can be null; if one of the arguments is null, the result is the null value.
1522
.SH EXAMPLES
1623
\fBExample 1:\fR
1724

@@ -49,6 +56,33 @@ CALL sha256('testpwd', ?)
4956

5057
Return Status = 0
5158
.fi
59+
.PP
60+
\fBExample 4:\fR
61+
62+
.br
63+
.nf
64+
SELECT sha256('testpwd', '12345678') FROM SYSIBM.SYSDUMMY1
65+
66+
1
67+
-------------------------------------------------------
68+
$5$12345678$.oVAnOr/.FK8fYNiFPvoXPQvEOT9Calecygw6K9wIb9
69+
70+
1 record(s) selected.
71+
.fi
72+
.PP
73+
\fBExample 5:\fR
74+
75+
.br
76+
.nf
77+
CALL sha256('testpwd', '12345678', ?)
78+
79+
Value of output parameters
80+
--------------------------
81+
Parameter Name : HASH
82+
Parameter Value : $5$12345678$.oVAnOr/.FK8fYNiFPvoXPQvEOT9Calecygw6K9wIb9
83+
84+
Return Status = 0
85+
.fi
5286
.SH AUTHOR
5387
Written by Helmut K. C. Tessarek.
5488
.SH "BUGS"

man/man8/sha512.8

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
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"
22
.SH NAME
33
sha512 \- DB2 UDF and SP to generate an SHA512 hash
44
.SH SYNOPSIS
5-
>>-SHA512--(--expression--)------------------------------------><
5+
.nf
6+
>>-SHA512--(--expression--+---------+--)-----------------------><
7+
'-,--salt-'
8+
.fi
69
.PP
7-
>>-SHA512--(--expression--,--hash--)---------------------------><
10+
.nf
11+
>>-SHA512--(--expression--+---------+--,--hash--)--------------><
12+
'-,--salt-'
13+
.fi
814
.SH DESCRIPTION
915
SHA512 algorithm. The sha512 routine returns a glibc2's crypt hash. If the system's crypt does not support sha-512,
1016
an SQLSTATE 39702 is returned.
1117
.PP
1218
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.
1320
.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.
1522
.SH EXAMPLES
1623
\fBExample 1:\fR
1724

@@ -49,6 +56,33 @@ CALL sha512('testpwd', ?)
4956

5057
Return Status = 0
5158
.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
5286
.SH AUTHOR
5387
Written by Helmut K. C. Tessarek.
5488
.SH "BUGS"

0 commit comments

Comments
 (0)