Package org.apache.maven.index.packer
Class DigesterUtils
java.lang.Object
org.apache.maven.index.packer.DigesterUtils
A util class to calculate various digests on Strings. Useful for some simple password management.
- Author:
- cstamas
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic char[]
encodeHex
(byte[] data) Blatantly copied from commons-codec version 1.3static String
getMd5Digest
(File file) Calculates a SHA1 digest for a file.static String
Calculates a SHA1 digest for a stream.static String
getMd5Digest
(String content) Calculates a SHA1 digest for a string.static String
getSha1Digest
(File file) Calculates a SHA1 digest for a file.static String
Calculates a SHA1 digest for a stream.static String
getSha1Digest
(String content) Calculates a SHA1 digest for a string.
-
Constructor Details
-
DigesterUtils
public DigesterUtils()
-
-
Method Details
-
getSha1Digest
Calculates a SHA1 digest for a string.- Parameters:
content
-- Returns:
-
getSha1Digest
Calculates a SHA1 digest for a stream.- Parameters:
is
-- Returns:
-
getSha1Digest
Calculates a SHA1 digest for a file.- Parameters:
file
-- Returns:
- Throws:
IOException
-
getMd5Digest
Calculates a SHA1 digest for a string.- Parameters:
content
-- Returns:
-
getMd5Digest
Calculates a SHA1 digest for a stream.- Parameters:
is
-- Returns:
-
getMd5Digest
Calculates a SHA1 digest for a file.- Parameters:
file
-- Returns:
- Throws:
IOException
-
encodeHex
public static char[] encodeHex(byte[] data) Blatantly copied from commons-codec version 1.3- Parameters:
data
-- Returns:
-