| java.lang.Object org.apache.java.security.MessageDigest org.apache.java.security.MD5
MD5 | final public class MD5 extends MessageDigest (Code) | | This class implements the Message Digest 5 algorithm (MD5) as
defined in RFC-1321.
Note: even if standard Java 1.1 APIs already provide a
MD5 implementation, this class is used on those Java runtime
environments (like Kaffe) where the package
java.security is highly improbable to be found.
author: Stefano Mazzocchi version: $Id: MD5.java 264148 2005-08-29 14:21:04Z henning $ |
Constructor Summary | |
public | MD5() Creates the algorithm and reset its state. |
Method Summary | |
public void | append(byte[] block, int offset, int length) Append another block of specified length to the message
starting at the given offset. | public byte[] | digest(byte[] block, int offset, int length) Appends a message block with specified length starting from the
given offset, and return its message digest. | final public static void | main(String[] ignored) | public void | reset() Resets the state of the class. | public static byte[] | toBytes(long n) Converts a long to a 8-byte array using low order first.
Parameters: n - A long. |
padding | static byte padding(Code) | | MD5 Functions **********************
|
MD5 | public MD5()(Code) | | Creates the algorithm and reset its state.
|
append | public void append(byte[] block, int offset, int length)(Code) | | Append another block of specified length to the message
starting at the given offset.
Parameters: block - A byte[]. Parameters: offset - An int. Parameters: length - An int. |
digest | public byte[] digest(byte[] block, int offset, int length)(Code) | | Appends a message block with specified length starting from the
given offset, and return its message digest.
Parameters: block - A byte[]. Parameters: offset - An int. Parameters: length - An int. |
reset | public void reset()(Code) | | Resets the state of the class. Beware: calling this
method erases all data previously inserted.
|
toBytes | public static byte[] toBytes(long n)(Code) | | Converts a long to a 8-byte array using low order first.
Parameters: n - A long. A byte[]. |
|
|