agjava.util
Class Md5
java.lang.Object
|
+--agjava.util.Md5
- public class Md5
- extends java.lang.Object
Constructor Summary |
Md5(java.lang.String input)
Construct a digestifier for the given string. |
Md5(java.lang.String input,
java.lang.String enc)
Construct a digestifier for the given string. |
Method Summary |
byte[] |
getDigest()
Get the digest for our input stream.
|
java.lang.String |
getStringDigest()
Get the digest, as a proper string. |
byte[] |
processString()
Get the digest, for this string digestifier.
|
static java.lang.String |
stringify(byte[] buf)
|
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Md5
public Md5(java.lang.String input,
java.lang.String enc)
- Construct a digestifier for the given string.
- Parameters:
input
- The string to be digestified.encoding
- the encoding name used (such as UTF8)
Md5
public Md5(java.lang.String input)
- Construct a digestifier for the given string.
- Parameters:
input
- The string to be digestified.
stringify
public static java.lang.String stringify(byte[] buf)
getDigest
public byte[] getDigest()
throws java.io.IOException
- Get the digest for our input stream.
This method constructs the input stream digest, and return it, as a
a String, following the MD5 (rfc1321) algorithm,
- Returns:
- An instance of String, giving the message digest.
- Throws:
- java.io.IOException - Thrown if the digestifier was unable to read the
input stream.
processString
public byte[] processString()
- Get the digest, for this string digestifier.
This method doesn't throw any IOException, since it knows that the
underlying stream ws built from a String.
getStringDigest
public java.lang.String getStringDigest()
- Get the digest, as a proper string.