| java.lang.Object HTTPClient.MD5
MD5 | class MD5 (Code) | | Implementation of RSA's MD5 hash generator
version: 0.3-2 18/06/1999 author: Santeri Paavolainen |
Field Summary | |
MD5State | finals If Final() has been called, finals is set to the current finals
state. | static byte | padding | MD5State | state |
Method Summary | |
public synchronized byte[] | Final() Returns array of bytes (16 bytes) representing hash as of the
current state of this object. | public synchronized void | Init() | public void | Update(MD5State stat, byte buffer, int offset, int length) | public void | Update(byte buffer, int offset, int length) | public void | Update(byte buffer, int length) | public void | Update(byte buffer) | public void | Update(byte b) | public void | Update(String s) Update buffer with given string. | public void | Update(int i) | public static String | asHex(byte hash) Turns array of bytes into string representing each byte as
unsigned hex number. | public String | asHex() |
finals | MD5State finals(Code) | | If Final() has been called, finals is set to the current finals
state. Any Update() causes this to be set to null.
|
padding | static byte padding(Code) | | Padding for Final()
|
state | MD5State state(Code) | | MD5 state
|
MD5 | public MD5()(Code) | | Class constructor
|
MD5 | public MD5(Object ob)(Code) | | Initialize class, and update hash with ob.toString()
Parameters: ob - Object, ob.toString() is used to update hashafter initialization |
Final | public synchronized byte[] Final()(Code) | | 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.
Array of 16 bytes, the hash of all updated bytes |
Init | public synchronized void Init()(Code) | | Initialize MD5 internal state (object can be reused just by
calling Init() after every Final()
|
Update | public void Update(MD5State stat, byte buffer, int offset, int length)(Code) | | Updates hash with the bytebuffer given (using at maximum length bytes from
that buffer)
Parameters: state - Which state is updated Parameters: buffer - Array of bytes to be hashed Parameters: offset - Offset to buffer array Parameters: length - Use at maximum `length' bytes (absolutemaximum is buffer.length) |
Update | public void Update(byte buffer, int offset, int length)(Code) | | Plain update, updates this object
|
Update | public void Update(byte buffer, int length)(Code) | | |
Update | public void Update(byte buffer)(Code) | | Updates hash with given array of bytes
Parameters: buffer - Array of bytes to use for updating the hash |
Update | public void Update(byte b)(Code) | | Updates hash with a single byte
Parameters: b - Single byte to update the hash |
Update | public void Update(String s)(Code) | | Update buffer with given string.
Parameters: s - String to be update to hash (is used ass.getBytes()) |
Update | public void Update(int i)(Code) | | Update buffer with a single integer (only & 0xff part is used,
as a byte)
Parameters: i - Integer value, which is then converted tobyte as i & 0xff |
asHex | public static String asHex(byte hash)(Code) | | Turns array of bytes into string representing each byte as
unsigned hex number.
Parameters: hash - Array of bytes to convert to hex-string Generated hex string |
asHex | public String asHex()(Code) | | Returns 32-character hex representation of this objects hash
String of this object's hash |
|
|