进行MD5加密
@param info 要加密的信息
@return String 加密后的字符串
482175
public static String encryptToMD5(String info) {
		byte[] digesta = null;
		try {
			MessageDigest alga = MessageDigest.getInstance("MD5");
			alga.update(info.getBytes());
			digesta = alga.digest();
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		// to string
		return byte2hex(digesta);
	}
595251
function md5 (obj) {
    var md5sum = CRYPTO.createHash('md5');
    obj = typeof obj === 'string' ? obj : JSON.stringify(obj);
    md5sum.update(obj);
    return md5sum.digest('hex');
}
898069
public static String getMD5Digest(String password) {
		MessageDigest md = null;
		try {
			md = MessageDigest.getInstance("MD5");
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
			return null;
		}
		md.update(password.getBytes());
		byte[] digest = md.digest();
		StringBuffer sb = new StringBuffer();
		for (int i : digest) {
			if (i < 0) {
				i += 256;
			}
			if (i < 16) {
				sb.append('0');
			}
			sb.append(Integer.toHexString(i));
		}
		return sb.toString();
	}
100151
def md5sum(content):
    '''
    '''
    md5 = hashlib.md5()
    md5.update(force_bytes(content))
    return md5.hexdigest()
301416
public static function md5()
    {
        // Helper Class Exists
        if (isset(self::$ChecksumHelper)) {
            return self::$ChecksumHelper;
        }
        // Initialize Class
        self::$ChecksumHelper = new ChecksumHelper();
        // Return Helper Class
        return self::$ChecksumHelper;
    }
1004711
static String getMd5Hash(byte[] bytes) throws NoSuchAlgorithmException {

        String hash;
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(bytes);
            byte[] digest = md.digest();

            char[] hexCode = "0123456789ABCDEF".toCharArray();
            StringBuilder r = new StringBuilder(digest.length * 2);
            for (byte b : digest) {
                r.append(hexCode[(b >> 4) & 0xF]);
                r.append(hexCode[(b & 0xF)]);
            }

            hash = r.toString().toUpperCase();
        }catch (NoSuchAlgorithmException e){
            throw e;
        }
        return hash;
    }
570062
@SuppressWarnings("checkstyle:magicnumber")
    public static String toMD5String(String str) {
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            if (md == null || str == null) {
                return null;
            }
            byte[] byteData = md.digest(str.getBytes(Charset.forName("UTF-8")));

            StringBuilder sb = new StringBuilder();
            for (byte aByteData : byteData) {
                sb.append(Integer.toString((aByteData & 0xff) + 0x100, 16).substring(1));
            }
            return sb.toString();
        } catch (NoSuchAlgorithmException ignored) {
            return null;
        }
    }
1068747
def md5(self):
        """"""
        return hashlib.md5('_'.join([self.CHROM, str(self.POS), self.REF,
                                     self.ALT])).hexdigest()
452869
public static String md5(String s) {
		if (s == null) {
			return "";
		}
		try {
			MessageDigest md = MessageDigest.getInstance("MD5");
			md.update(s.getBytes());

			byte[] byteData = md.digest();

			//convert the byte to hex format method 1
			StringBuilder sb = new StringBuilder();
			for (int i = 0; i < byteData.length; i++) {
				sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));
			}
			return sb.toString();
		} catch (NoSuchAlgorithmException ex) {
			return "";
		}
	}
991173
public static String digestMD5(InputStream inputStream) {
        int size = 4096;
        int readLen = 32;
        StringBuilder md5String = new StringBuilder();
        try {
            byte[] buffer = new byte[size];
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            int len;
            while ((len = inputStream.read(buffer, 0, size)) != -1) {
                md5.update(buffer, 0, len);
            }
            BigInteger bigInteger = new BigInteger(1, md5.digest());
            md5String.append(bigInteger.toString(16));
            if (md5String.length() < readLen) {
                int j = readLen - md5String.length();
                for (int i = 0; i < j; i++) {
                    md5String.insert(0, "0");
                }
            }
        } catch (NoSuchAlgorithmException | IOException e) {
            throw new IllegalArgumentException(e);
        }
        return md5String.toString();
    }
670081
public static String md5File(String filePath) {
        File file = StringKit.isBlank(filePath) ? null : new File(filePath);
        return md5File(file);
    }
314624
function md5(value) {
    let ins = crypto.createHash('md5');
    ins.update(value);
    return ins.digest('hex');
}
1094683
function _md5( message ) {
    const hash = crypto.createHash( 'md5' );
    hash.update( message );
    return hash.digest( 'hex' );
}
1046891
public static String md5(final String message, final int nchar) {
        final String hash = md5(message);
        return nchar > hash.length() ? hash : hash.substring(0, nchar);
    }
1038316
private static function hkdf($ikm, $info = '')
    {
        $salt = str_repeat("\x00", 32);
        $prk = hash_hmac('sha256', $ikm, $salt, true);

        $t = $last_block = '';
        $length = 0;

        for ($block_index = 1; $length < 16; ++$block_index) {
            $last_block = hash_hmac('sha256', $last_block.$info.chr($block_index), $prk, true);
            $t .= $last_block;
            $length = mb_strlen($t, '8bit');
        }

        return mb_substr($t, 0, 16, '8bit');
    }
906115
public static String generateMD5(final String input) {
        try {
            return generateMD5(input.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
            LOG.debug("An error occurred generating the MD5 Hash of the input string", e);
            return null;
        }
    }
881196
public static String md5(byte[] source) {
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(source);
            byte tmp[] = md.digest();
            char str[] = new char[32];
            int k = 0;
            for (byte b : tmp) {
                str[k++] = hexDigits[b >>> 4 & 0xf];
                str[k++] = hexDigits[b & 0xf];
            }
            return new String(str);

        } catch (Exception e) {
            throw new IllegalArgumentException(e);
        }
    }