Defined in rfc 2617 as H(data) = MD5(data);

@param data data
@return MD5(data)
481800
public static String encryptMD5(String data) {
        try {
            MessageDigest digest = MessageDigest.getInstance("MD5");
            return copyValueOf(Hex.encodeHex(digest.digest(data.getBytes(StandardCharsets.UTF_8))));
        } catch (final NoSuchAlgorithmException ex) {
            throw new TechnicalException("Failed to instantiate an MD5 algorithm", ex);
        }
    }
435385
protected String hashByteArray(byte[] data) {
        if (mCRC32 != null) {
            return hashCRC32(data);
        } else if (mHashAlgorithm != null) {
            return messageDigest(data);
        } else {
            // Default.
            return hashCRC32(data);
        }
    }
1084357
public String encryptHex(String data, String charset) {
		return HexUtil.encodeHexStr(encrypt(data, charset));
	}
438113
@Override
    public byte[] decode(final String data) {
        return data != null ? data.getBytes(CHARSET) : null;
    }
102075
public static String md5Hex(String data, String charset) {
		return new MD5().digestHex(data, charset);
	}
1534
def md5(source):
    
    # fix passing char '+' from source
    source = source.replace("%2B", "+")
    with open(source) as file_to_check:
        data = file_to_check.read()
        return hashlib.md5(data).hexdigest()
1158230
public static String hexSHA512(String data) {
        Objects.requireNonNull(data, Required.DATA.toString());
        
        return DigestUtils.sha512Hex(data);
    }
265736
public byte[] encrypt(String data, String charset) {
		return encrypt(StrUtil.bytes(data, charset));
	}
384102
public static long createHash(byte[] data) {
        long h = 0;
        byte[] res;

        synchronized (digestFunction) {
            res = digestFunction.digest(data);
        }

        for (int i = 0; i < 4; i++) {
            h <<= 8;
            h |= ((int) res[i]) & 0xFF;
        }
        return h;
    }
448879
function md5(data, digest) {
            var hash = "";

            if (!digest) { digest = 'binary'; }

            if (digest === 'buffer') {
                digest = undefined;
                // todo: 不支持 buffer 类型的 hash
                return "";
            }

            if (typeof data === 'string') {
                switch (digest) {
                    case "binary":
                        return SparkMD5.hash(data, true);
                    case "hex":
                        return SparkMD5.hash(data);
                    case "base64":
                        return TableStore.util.hexToBase64(SparkMD5.hash(data));
                    default:
                        return "";
                }
            }
            else {  // array buffer
                switch (digest) {
                    case "binary":
                        return SparkMD5.ArrayBuffer.hash(data, true);
                    case "hex":
                        return SparkMD5.ArrayBuffer.hash(data);
                    case "base64":
                        return TableStore.util.hexToBase64(SparkMD5.ArrayBuffer.hash(data));
                    default:
                        return "";
                }
            }
        }
649173
public static byte[] hashToBytes(final char[] data, final long seed) {
    if ((data == null) || (data.length == 0)) {
      return null;
    }
    return toByteArray(hash(data, seed));
  }
197259
public static String md5(byte[] data, byte[] salt) {
        if (data == null || salt == null) return null;
        byte[] dataSalt = new byte[data.length + salt.length];
        System.arraycopy(data, 0, dataSalt, 0, data.length);
        System.arraycopy(salt, 0, dataSalt, data.length, salt.length);
        return bytes2HexString(md5ToByte(dataSalt));
    }
276579
public static String md5Hex(final String input) {
		if (input == null) {
			throw new NullPointerException("String is null");
		}

    	MessageDigest digest = null;
    	
    	try {
    		digest = MessageDigest.getInstance("MD5");
    	} catch (NoSuchAlgorithmException e) {
    		// this should never happen
    		throw new RuntimeException(e);
    	}
        
        byte[] hash = digest.digest(input.getBytes());
        
        return DatatypeConverter.printHexBinary(hash);
    }
976033
static public byte[] getEnglishBytes(String data) {
        if (null == data) {
            return null;
        }
        char[] chars = data.toCharArray();
        byte[] bytes = new byte[chars.length];
        for (int i = 0; i < chars.length; i++) {
            bytes[i] = (byte) chars[i];
        }
        return bytes;
    }
924091
public static String hmacSHA256(String data, String key) {
        return hmacSHA256(data.getBytes(), key.getBytes());
    }
1082837
function MD5(source) { // @arg String - source string
                       // @ret MD5HashHexString
//{@dev
    $valid($type(source, "String"), MD5, "source");
//}@dev

    var md5 = DataType["Array"]["toHexStringArray"](
                    MD5_encode(
                        DataType["Uint8Array"]["fromString"](source) ) );

    return md5.join("");
}
202542
public static byte[] encode(final byte[] data) throws IOException {
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        DeflaterOutputStream deflateOut = null;
        try {
            deflateOut = new DeflaterOutputStream(byteOut);
            deflateOut.write(data);
            deflateOut.close();
            byteOut.close();
            return byteOut.toByteArray();
        } finally {
            deflateOut.close();
            byteOut.close();
        }
    }