Skip to content

Commit a141fac

Browse files
committed
update db2-hash-routines.8 to include sha1_hex
[ci skip]
1 parent b2d65b6 commit a141fac

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

man/man8/db2-hash-routines.8

+51-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH db2-hash-routines "8" "May 2017" "db2-hash-routines 1.8" "DB2 UDFs and Stored Procedures"
1+
.TH db2-hash-routines "8" "August 2017" "db2-hash-routines 1.8" "DB2 UDFs and Stored Procedures"
22
.SH NAME
33
db2-hash-routines \- DB2 UDFs and SPs to generate and validate hashes
44
.SH SYNOPSIS
@@ -18,6 +18,8 @@ db2-hash-routines \- DB2 UDFs and SPs to generate and validate hashes
1818
.PP
1919
>>-SHA256_HEX--(--expression--)--------------------------------><
2020
.PP
21+
>>-SHA1_HEX--(--expression--)----------------------------------><
22+
.PP
2123
.nf
2224
>>-SHA256--(--expression--+---------+--)-----------------------><
2325
'-,--salt-'
@@ -46,6 +48,8 @@ db2-hash-routines \- DB2 UDFs and SPs to generate and validate hashes
4648
.PP
4749
>>-SHA256_HEX--(--expression--,--hash--)-----------------------><
4850
.PP
51+
>>-SHA1_HEX--(--expression--,--hash--)-------------------------><
52+
.PP
4953
.nf
5054
>>-SHA256--(--expression--+---------+--,--hash--)--------------><
5155
'-,--salt-'
@@ -144,6 +148,18 @@ The argument can be a character string that is either a CHAR or VARCHAR not exce
144148
.IP
145149
The result of the routine is CHAR(64). The result can be null; if the argument is null, the result is the null value.
146150
.TP
151+
\fBsha1_hex( '\fR\fIcleartext\fR\fB' )\fR
152+
.RS 0
153+
\fBsha1_hex( '\fR\fIcleartext\fR\fB', \fR\fI:hash\fR\fB )\fR
154+
.PD 0
155+
.IP
156+
SHA1 algorithm. The sha1_hex routine returns a 40-character hexadecimal hash.
157+
.PD
158+
.IP
159+
The argument can be a character string that is either a CHAR or VARCHAR not exceeding 4096 bytes.
160+
.IP
161+
The result of the routine is CHAR(40). The result can be null; if the argument is null, the result is the null value.
162+
.TP
147163
\fBsha256( '\fR\fIcleartext\fR\fB' [, '\fR\fIsalt\fR\fB'] )\fR
148164
.RS 0
149165
\fBsha256( '\fR\fIcleartext\fR\fB' [, '\fR\fIsalt\fR\fB'], \fR\fI:hash\fR\fB )\fR
@@ -424,6 +440,40 @@ CALL sha256_hex('testpwd', ?)
424440
Return Status = 0
425441
.fi
426442
.PP
443+
\fBsha1_hex(1):\fR
444+
.br
445+
Inserting the user \fItest\fR and the sha1 crypted clear text \fItestpwd\fR to the table \fIusers\fR.
446+
.PP
447+
.nf
448+
INSERT INTO USERS (username, password)
449+
VALUES ('test', sha1_hex('testpwd'))
450+
.fi
451+
.PP
452+
\fBsha1_hex(2):\fR
453+
.br
454+
.nf
455+
SELECT sha1_hex('testpwd') FROM SYSIBM.SYSDUMMY1
456+
457+
1
458+
----------------------------------------
459+
98ef0758e6aac6f9a9e1197548c8190b72c9581d
460+
461+
1 record(s) selected.
462+
.fi
463+
.PP
464+
\fBsha1_hex(3):\fR
465+
.br
466+
.nf
467+
CALL sha1_hex('testpwd', ?)
468+
469+
Value of output parameters
470+
--------------------------
471+
Parameter Name : HASH
472+
Parameter Value : 98ef0758e6aac6f9a9e1197548c8190b72c9581d
473+
474+
Return Status = 0
475+
.fi
476+
.PP
427477
\fBsha256 (1):\fR
428478
.br
429479
Inserting the user \fItest\fR and the sha256 crypted clear text \fItestpwd\fR to the table \fIusers\fR.

0 commit comments

Comments
 (0)