Package net.timewalker.ffmq4.utils.md5
Class MD5
- java.lang.Object
-
- net.timewalker.ffmq4.utils.md5.MD5
-
public final class MD5 extends Object
Modifed version of Fast MD5 for Java 2.7.1 (from http://www.twmacinta.com/myjava/fast_md5.php) Modifications from the original source : - Removed native code support - Stripped some code - Removed wacky synchronization - Reformatted code to match Java and FFMQ standards
This Java class has been derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm and its reference implementation.- Author:
- Santeri Paavolainen
, Timothy W Macinta (twm@alum.mit.edu) (optimizations and bug fixes)
-
-
Constructor Summary
Constructors Constructor Description MD5()Class constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]digest()Returns array of bytes (16 bytes) representing hash as of the current state of this object.voidreset()Reset MD5 internal statevoidupdate(byte[] buffer)Updates hash with given array of bytesvoidupdate(byte[] buffer, int offset, int length)Updates hash with the bytebuffer given (using at maximum length bytes from that buffer)
-
-
-
Method Detail
-
reset
public void reset()
Reset MD5 internal state
-
update
public void update(byte[] buffer, int offset, int length)Updates hash with the bytebuffer given (using at maximum length bytes from that buffer)- Parameters:
buffer- Array of bytes to be hashedoffset- Offset to buffer arraylength- Use at maximum `length' bytes (absolute maximum is buffer.length)
-
update
public void update(byte[] buffer)
Updates hash with given array of bytes- Parameters:
buffer- Array of bytes to use for updating the hash
-
digest
public byte[] digest()
Returns array of bytes (16 bytes) representing hash as of the current state of this object. Note: getting a hash does not invalidate the hash object, it only creates a copy of the real state which is finalized.- Returns:
- Array of 16 bytes, the hash of all updated bytes
-
-