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"
2
2
.SH NAME
3
3
db2-hash-routines \- DB2 UDFs and SPs to generate and validate hashes
4
4
.SH SYNOPSIS
@@ -18,6 +18,8 @@ db2-hash-routines \- DB2 UDFs and SPs to generate and validate hashes
18
18
.PP
19
19
>>-SHA256_HEX--(--expression--)--------------------------------><
20
20
.PP
21
+ >>-SHA1_HEX--(--expression--)----------------------------------><
22
+ .PP
21
23
.nf
22
24
>>-SHA256--(--expression--+---------+--)-----------------------><
23
25
'-,--salt-'
@@ -46,6 +48,8 @@ db2-hash-routines \- DB2 UDFs and SPs to generate and validate hashes
46
48
.PP
47
49
>>-SHA256_HEX--(--expression--,--hash--)-----------------------><
48
50
.PP
51
+ >>-SHA1_HEX--(--expression--,--hash--)-------------------------><
52
+ .PP
49
53
.nf
50
54
>>-SHA256--(--expression--+---------+--,--hash--)--------------><
51
55
'-,--salt-'
@@ -144,6 +148,18 @@ The argument can be a character string that is either a CHAR or VARCHAR not exce
144
148
.IP
145
149
The result of the routine is CHAR(64). The result can be null; if the argument is null, the result is the null value.
146
150
.TP
151
+ \fB sha1_hex( ' \fR\fI cleartext \fR\fB ' ) \fR
152
+ .RS 0
153
+ \fB sha1_hex( ' \fR\fI cleartext \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
147
163
\fB sha256( ' \fR\fI cleartext \fR\fB ' [, ' \fR\fI salt \fR\fB '] ) \fR
148
164
.RS 0
149
165
\fB sha256( ' \fR\fI cleartext \fR\fB ' [, ' \fR\fI salt \fR\fB '], \fR\fI :hash \fR\fB ) \fR
@@ -424,6 +440,40 @@ CALL sha256_hex('testpwd', ?)
424
440
Return Status = 0
425
441
.fi
426
442
.PP
443
+ \fB sha1_hex(1): \fR
444
+ .br
445
+ Inserting the user \fI test \fR and the sha1 crypted clear text \fI testpwd \fR to the table \fI users \fR .
446
+ .PP
447
+ .nf
448
+ INSERT INTO USERS (username, password)
449
+ VALUES ('test', sha1_hex('testpwd'))
450
+ .fi
451
+ .PP
452
+ \fB sha1_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
+ \fB sha1_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
427
477
\fB sha256 (1): \fR
428
478
.br
429
479
Inserting the user \fI test \fR and the sha256 crypted clear text \fI testpwd \fR to the table \fI users \fR .
0 commit comments