java.lang.Object
mindbright.security.MessageDigest
mindbright.security.MD5
- All Implemented Interfaces:
- java.lang.Cloneable
- public final class MD5
- extends MessageDigest
- implements java.lang.Cloneable
|
Field Summary |
(package private) byte[] |
buffer
|
private long |
count
|
(package private) int[] |
hash
|
(package private) static byte[] |
padding
|
private int |
rest
|
private int[] |
x
|
|
Method Summary |
int |
blockSize()
|
java.lang.Object |
clone()
This method may be called to create a new copy of the
Object. |
byte[] |
digest()
|
int |
digestInto(byte[] dest,
int destOff)
|
private static int |
FF(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
java.lang.String |
getName()
|
private static int |
GG(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
int |
hashSize()
|
private static int |
HH(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
private static int |
II(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
void |
reset()
|
private static int |
rotateLeft(int x,
int n)
|
(package private) void |
transform(byte[] data,
int offset)
|
void |
update(byte[] data,
int offset,
int length)
|
x
private int[] x
count
private long count
rest
private int rest
hash
int[] hash
buffer
byte[] buffer
padding
static byte[] padding
MD5
public MD5()
MD5
private MD5(MD5 c)
rotateLeft
private static int rotateLeft(int x,
int n)
FF
private static int FF(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
GG
private static int GG(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
HH
private static int HH(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
II
private static int II(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
transform
void transform(byte[] data,
int offset)
clone
public java.lang.Object clone()
- Description copied from class:
java.lang.Object
- This method may be called to create a new copy of the
Object. The typical behavior is as follows:
o == o.clone() is false
o.getClass() == o.clone().getClass()
is true
o.equals(o) is true
However, these are not strict requirements, and may
be violated if necessary. Of the three requirements, the
last is the most commonly violated, particularly if the
subclass does not override Object.equals(Object)>Object.equals(Object) 55 .
If the Object you call clone() on does not implement
java.lang.Cloneable (which is a placeholder interface), then
a CloneNotSupportedException is thrown. Notice that
Object does not implement Cloneable; this method exists
as a convenience for subclasses that do.
Object's implementation of clone allocates space for the
new Object using the correct class, without calling any
constructors, and then fills in all of the new field values
with the old field values. Thus, it is a shallow copy.
However, subclasses are permitted to make a deep copy.
All array types implement Cloneable, and override
this method as follows (it should never fail):
public Object clone()
{
try
{
super.clone();
}
catch (CloneNotSupportedException e)
{
throw new InternalError(e.getMessage());
}
}
- Overrides:
clone in class MessageDigest
getName
public java.lang.String getName()
- Specified by:
getName in class MessageDigest
reset
public void reset()
- Specified by:
reset in class MessageDigest
update
public void update(byte[] data,
int offset,
int length)
- Specified by:
update in class MessageDigest
digest
public byte[] digest()
- Specified by:
digest in class MessageDigest
digestInto
public int digestInto(byte[] dest,
int destOff)
- Overrides:
digestInto in class MessageDigest
blockSize
public int blockSize()
- Specified by:
blockSize in class MessageDigest
hashSize
public int hashSize()
- Specified by:
hashSize in class MessageDigest