public final class MD5 extends MessageDigest implements Cloneable
The MD5 message-digest algorithm takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest.
References:
| Constructor and Description |
|---|
MD5()
Creates a MD5 object with default initial state.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Clones this object.
|
byte[] |
engineDigest()
Completes the hash computation by performing final operations
such as padding.
|
int |
engineDigest(byte[] hashvalue,
int offset,
int length)
Completes the hash computation by performing final operations
such as padding.
|
int |
engineGetDigestLength()
Returns the digest length in bytes.
|
void |
engineReset()
Reset then initialize the digest context.
Overrides the protected abstract method of java.security.MessageDigestSpi. |
void |
engineUpdate(byte input)
Updates the digest using the specified byte.
|
void |
engineUpdate(byte[] input,
int offset,
int length)
Updates the digest using the specified array of bytes,
starting at the specified offset.
Input length can be any size. |
protected void |
init()
Initialize the digest context.
|
digest, digest, digest, getAlgorithm, getDigestLength, getInstance, getInstance, getInstance, getProvider, isEqual, reset, toString, update, update, update, updateengineUpdatepublic Object clone() throws CloneNotSupportedException
clone in class MessageDigestCloneNotSupportedExceptionpublic void engineReset()
java.security.MessageDigestSpi.engineReset in class MessageDigestSpiprotected void init()
public void engineUpdate(byte input)
java.security.MessageDigestSpi.engineUpdate in class MessageDigestSpiinput - the byte to use for the update.public void engineUpdate(byte[] input,
int offset,
int length)
java.security.MessageDigestSpi.engineUpdate in class MessageDigestSpiinput - the array of bytes to use for the update.offset - the offset to start from in the array of bytes.length - the number of bytes to use, starting at offset.public byte[] engineDigest()
java.security.MessageDigestSpi.engineDigest in class MessageDigestSpipublic int engineGetDigestLength()
java.security.MessageDigestSpi.engineGetDigestLength in class MessageDigestSpipublic int engineDigest(byte[] hashvalue,
int offset,
int length)
throws DigestException
java.security.MessageDigestSpi.engineDigest in class MessageDigestSpihashvalue - the output buffer in which to store the digest.offset - offset to start from in the output bufferlength - number of bytes within buf allotted for the digest.
Both this default implementation and the SUN provider
do not return partial digests. The presence of this
parameter is solely for consistency in our API's.
If the value of this parameter is less than the
actual digest length, the method will throw a
DigestException. This parameter is ignored if its
value is greater than or equal to the actual digest
length.DigestExceptionCopyright © 2018. All rights reserved.