public class MD5
extends java.lang.Object
| Constructor | Description |
|---|---|
MD5() |
Class constructor
|
MD5(java.lang.Object ob) |
Initialize class, and update hash with ob.toString()
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
asHex() |
Returns 32-character hex representation of this objects hash
|
static java.lang.String |
asHex(byte[] hash) |
Turns array of bytes into string representing each byte as
unsigned hex number.
|
byte[] |
Final() |
Returns array of bytes (16 bytes) representing hash as of the
current state of this object.
|
void |
Init() |
Initialize MD5 internal state (object can be reused just by
calling Init() after every Final()
|
static java.lang.String |
md5_digest(java.lang.String user,
java.lang.String password,
java.lang.String ses_name) |
|
static java.lang.String |
pwd_magic_encrypt(java.lang.String user_name,
java.lang.String password) |
|
void |
Update(byte b) |
Updates hash with a single byte
|
void |
Update(byte[] buffer) |
Updates hash with given array of bytes
|
void |
Update(byte[] buffer,
int length) |
Plain update, updates this object
|
void |
Update(byte[] buffer,
int offset,
int length) |
Plain update, updates this object
|
void |
Update(int i) |
Update buffer with a single integer (only & 0xff part is used,
as a byte)
|
void |
Update(java.lang.String s) |
Update buffer with given string.
|
void |
Update(openlink.util.MD5State stat,
byte[] buffer,
int offset,
int length) |
Updates hash with the bytebuffer given (using at maximum length bytes from
that buffer)
|
public MD5()
public MD5(java.lang.Object ob)
ob - Object, ob.toString() is used to update hash
after initializationpublic void Init()
public void Update(openlink.util.MD5State stat,
byte[] buffer,
int offset,
int length)
stat - Which state is updatedbuffer - Array of bytes to be hashedoffset - Offset to buffer arraylength - Use at maximum `length' bytes (absolute
maximum is buffer.length)public void Update(byte[] buffer,
int offset,
int length)
buffer - Array of bytesoffset - offset of data in arraylength - length of datapublic void Update(byte[] buffer,
int length)
buffer - Array of byteslength - length of datapublic void Update(byte[] buffer)
buffer - Array of bytes to use for updating the hashpublic void Update(byte b)
b - Single byte to update the hashpublic void Update(java.lang.String s)
s - String to be update to hash (is used as
s.getBytes())public void Update(int i)
i - Integer value, which is then converted to
byte as i & 0xffpublic byte[] Final()
public static java.lang.String asHex(byte[] hash)
hash - Array of bytes to convert to hex-stringpublic java.lang.String asHex()
public static java.lang.String md5_digest(java.lang.String user,
java.lang.String password,
java.lang.String ses_name)
public static java.lang.String pwd_magic_encrypt(java.lang.String user_name,
java.lang.String password)