public final class MD5
extends java.lang.Object
限定符和类型 | 方法和说明 |
---|---|
static java.lang.String |
getMD5(java.io.File file)
Get the md5 for the file, using less memory.
|
static java.lang.String |
getMD5(java.io.File file,
int bufLen)
Get the md5 for the file. call getMD5(FileInputStream is, int bufLen) inside.
|
static java.lang.String |
getMD5(java.io.File file,
int offset,
int length)
Get the md5 for the file, using less memory.
|
static java.lang.String |
getMD5(java.io.InputStream is,
int bufLen)
Get the md5 for inputStream.
|
static java.lang.String |
getMD5(java.io.InputStream is,
int bufLen,
int offset,
int length)
Get the md5 for inputStream.
|
static java.lang.String |
getMD5(java.lang.String file)
Get the md5 for the file, using less memory.
|
static java.lang.String |
getMD5(java.lang.String file,
int offset,
int length)
Get the md5 for the file, using less memory.
|
static java.lang.String |
getMD5ExtendBytes(java.io.File file,
int offset,
int length,
byte[] extend) |
static java.lang.String |
getMD5ExtendBytes(java.io.InputStream is,
int bufLen,
int offset,
int length,
byte[] extendBytes)
Get the md5 for inputStream.
|
static java.lang.String |
getMessageDigest(byte[] buffer)
get md5 string for input buffer
|
static byte[] |
getRawDigest(byte[] buffer)
get md5 in byte array
|
public static final java.lang.String getMessageDigest(byte[] buffer)
buffer
- data to be calculatedpublic static final byte[] getRawDigest(byte[] buffer)
buffer
- data to be calculatedpublic static final java.lang.String getMD5(java.io.InputStream is, int bufLen, int offset, int length)
is
- bufLen
- bytes number read from the stream once.
The less bufLen is the more times getMD5() method takes. Also the less bufLen is the less memory cost.public static final java.lang.String getMD5ExtendBytes(java.io.InputStream is, int bufLen, int offset, int length, byte[] extendBytes)
is
- bufLen
- offset
- length
- extendBytes
- extend bytes which would be add to the end of input stream for MD5 calculatingpublic static final java.lang.String getMD5(java.io.InputStream is, int bufLen)
is
- bufLen
- bytes number read from the stream once.
The less bufLen is the more times getMD5() method takes. Also the less bufLen is the less memory cost.public static java.lang.String getMD5(java.lang.String file)
public static java.lang.String getMD5(java.io.File file)
public static java.lang.String getMD5(java.io.File file, int bufLen)
file
- bufLen
- bytes number read from the stream once.
The less bufLen is the more times getMD5() method takes. Also the less bufLen cost less memory.public static java.lang.String getMD5(java.lang.String file, int offset, int length)
public static java.lang.String getMD5(java.io.File file, int offset, int length)
public static java.lang.String getMD5ExtendBytes(java.io.File file, int offset, int length, byte[] extend)