public static void main(String args[]) {

		if (args.length == 1) {
			// generate mode
			System.out.println(genenrateSHA(args[0]));
		} else if (args.length == 3) {
			// crack mode
			String hasedString = args[0];
			int maxPassLen = Integer.parseInt(args[1]);
			int numThreads = Integer.parseInt(args[2]);
			latch = new CountDownLatch(numThreads);
			Cracker myCracker = new Cracker(hasedString, maxPassLen);
			long startTime = System.currentTimeMillis();
			myCracker.kickOff(numThreads);
			try {
				latch.await();
			} catch (InterruptedException e) {	
			}
			long endTime = System.currentTimeMillis()-startTime;
			System.out.println("elapsed:" + endTime);
			System.out.println("all done!");
		} else {
			// argument error
			System.err.println("check your argument");
			System.exit(-1);
		}
	}