/* ************************************************************************** * * * 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 most current * * version of the Common Public License. * * http://www.opensource.org/licenses/cpl1.0.php * * * ************************************************************************** */ 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.RSHashCode(key)); System.out.println(" 2. JS-Hash Function Value: " + ghl.JSHashCode(key)); System.out.println(" 3. PJW-Hash Function Value: " + ghl.PJWHashCode(key)); System.out.println(" 4. ELF-Hash Function Value: " + ghl.ELFHashCode(key)); System.out.println(" 5. BKDR-Hash Function Value: " + ghl.BKDRHashCode(key)); System.out.println(" 6. SDBM-Hash Function Value: " + ghl.SDBMHashCode(key)); System.out.println(" 7. DJB-Hash Function Value: " + ghl.DJBHashCode(key)); System.out.println(" 8. DEK-Hash Function Value: " + ghl.DEKHashCode(key)); System.out.println(" 9. BP-Hash Function Value: " + ghl.BPHashCode(key)); System.out.println(" 9. FNV-Hash Function Value: " + ghl.FNVHashCode(key)); System.out.println("10. AP-Hash Function Value: " + ghl.APHashCode(key)); System.out.println("Press 'ENTER' to exit..."); BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); stdin.readLine(); } }