com.jaxfront.core.ui
Class Md5

java.lang.Object
  extended by com.jaxfront.core.ui.Md5

public class Md5
extends java.lang.Object


Constructor Summary
Md5(java.io.InputStream in)
          Construct a digestifier for the given input stream.
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
static java.lang.String createHash(java.lang.String value)
           
 byte[] getDigest()
          Get the digest for our input stream.
 java.lang.String getStringDigest()
          Get the digest, as a proper string.
static void main(java.lang.String[] args)
           
 byte[] processString()
          Get the digest, for this string digestifier.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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.

Md5

public Md5(java.io.InputStream in)
Construct a digestifier for the given input stream.

Parameters:
in - The input stream to be digestified.
Method Detail

createHash

public static java.lang.String createHash(java.lang.String value)

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.


main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException