public class DigestUtil extends Object
Modifier and Type | Method and Description |
---|---|
static void |
digestFile(String filename,
String algorithm)
Calculate digest of given file with given algorithm.
|
static String |
digestString(String pass,
String algorithm)
Calculate digest of given String using given algorithm.
|
static void |
main(String[] args)
Command line interface.
|
static void |
printUsage()
Print the command line usage string.
|
public static void main(String[] args)
args
- the arguments passed in on the command linepublic static void printUsage()
public static void digestFile(String filename, String algorithm)
filename
- the String name of the file to be hashedalgorithm
- the algorithm to be used to compute the digestpublic static String digestString(String pass, String algorithm) throws NoSuchAlgorithmException
pass
- the String to be hashedalgorithm
- the algorithm to be usedNoSuchAlgorithmException
- if the algorithm passed in cannot be foundCopyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.