-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathGeneralHashTest.java
More file actions
52 lines (43 loc) · 2.5 KB
/
Copy pathGeneralHashTest.java
File metadata and controls
52 lines (43 loc) · 2.5 KB
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
47
48
49
50
51
52
/*
**************************************************************************
* *
* General Purpose Hash Function Algorithms Test *
* *
* Author: Arash Partow - 2002 *
* URL: http://www.partow.net *
* URL: http://www.partow.net/programming/hashfunctions/index.html *
* *
* Copyright notice: *
* Free use of the General Purpose Hash Function Algorithms Library is *
* permitted under the guidelines and in accordance with the MIT License. *
* http://www.opensource.org/licenses/MIT *
* *
**************************************************************************
*/
import java.io.*;
import java.lang.*;
public class GeneralHashTest
{
public static void main(String args[]) throws IOException
{
GeneralHashFunctionLibrary ghl = new GeneralHashFunctionLibrary();
String key = "abcdefghijklmnopqrstuvwxyz1234567890";
System.out.println("General Purpose Hash Function Algorithms Test");
System.out.println("By Arash Partow - 2002\n");
System.out.println("Key: " + key);
System.out.println(" 1. RS-Hash Function Value: " + ghl.RSHash (key));
System.out.println(" 2. JS-Hash Function Value: " + ghl.JSHash (key));
System.out.println(" 3. PJW-Hash Function Value: " + ghl.PJWHash (key));
System.out.println(" 4. ELF-Hash Function Value: " + ghl.ELFHash (key));
System.out.println(" 5. BKDR-Hash Function Value: " + ghl.BKDRHash(key));
System.out.println(" 6. SDBM-Hash Function Value: " + ghl.SDBMHash(key));
System.out.println(" 7. DJB-Hash Function Value: " + ghl.DJBHash (key));
System.out.println(" 8. DEK-Hash Function Value: " + ghl.DEKHash (key));
System.out.println(" 9. BP-Hash Function Value: " + ghl.BPHash (key));
System.out.println(" 9. FNV-Hash Function Value: " + ghl.FNVHash (key));
System.out.println("10. AP-Hash Function Value: " + ghl.APHash (key));
System.out.println("Press 'ENTER' to exit...");
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
stdin.readLine();
}
}