-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathREADME
46 lines (30 loc) · 1.3 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
SHA-2 UDF package for Teradata Version 1.0 (2013-12-28)
Copyright (c) 2013 Akira Kuroda <[email protected]>
See the LICENSE file for license rights and limitations (MIT)
1. Summary
This package includes UDFs which generates SHA-2 message digest.
For SHA-2 itself, refer FIPS PUB 180-4[1].
2. Syntax
hash_sha256(varchar)
hash_sha512(varchar)
These functions take one char/varchar argument of any length and
returns 256/512-bit hash value as hexadecimal format.
It does not accept NULL value.
3. Installation
1 unpack the archive and go to src directory
2 start bteq and login to teradata
3 register UDFs by runnning scripts in the src diretcory:
.run file = hash_sha256.sql
.run file = hash_sha512.sql
4 if you would like to validate hash value generated by the UDF, run
test scripts in the test directory:
for hash_256: sha256test_cre.sql, sha256test_ins.sql and sha256test_chk.sql
for hash_512: sha512test_cre.sql, sha512test_ins.sql and sha512test_chk.sql
A. Rererences
[1] FIPS PUB 180-4
http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf
B. Example
hash_sha256('abc')
-> ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
hash_sha512('abc')
-> ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f