Java Utililty Methods MD5 Byte Array

List of utility methods to do MD5 Byte Array

Description

The list of methods to do MD5 Byte Array are organized into topic(s).

Method

byte[]md5Byte(String encryptStr)
md Byte
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(encryptStr.getBytes("UTF-8"));
return md.digest();
byte[]MD5Bytes(byte[] src)
MD Bytes
byte[] result = null;
if (src != null) {
    try {
        MessageDigest alg = MessageDigest.getInstance("MD5");
        result = alg.digest(src);
    } catch (NoSuchAlgorithmException e) {
return result;
byte[]md5Bytes(String message)
Encrypt the passed String using MD5.
try {
    MessageDigest md = MessageDigest.getInstance("MD5");
    return (md.digest(message.getBytes()));
} catch (NoSuchAlgorithmException e) {
return (null);
byte[]md5Bytes(String s)
md Bytes
if (s == null) {
    return null;
MessageDigest md5;
try {
    md5 = MessageDigest.getInstance("md5");
    md5.reset();
    md5.update(s.getBytes("UTF-8"), 0, s.length());
...
byte[]md5Digest(byte[] bytes)
Calculate the MD5 digest of the given bytes.
return digest(MD5_ALGORITHM_NAME, bytes);
Stringmd5Hex(byte data[])
md Hex
return toHexString(md5(data));
Stringmd5Hex(byte[] data)
Calculates the MD5 digest and returns the symbol as a 32 character hex string.
return new String(encodeHex(md5(data)));
byte[]md5key(byte[] key)
mdkey
try {
    return MessageDigest.getInstance("MD5").digest(key);
} catch (Exception e) {
    throw new IllegalStateException("Could not create hash");
byte[]md5P(final ByteBuffer bb)
md P
final byte[] array = bb.array();
final int position = bb.position();
final int len = bb.remaining();
return md5(array, position, len);
byte[]MD5Raw(byte[] src)
MD Raw
MessageDigest crypt = md5.get();
crypt.reset();
crypt.update(src);
return crypt.digest();