标签:except coder 方法 encode odi algorithm get dig encrypt
public class PasswordEncrypt {
public static String encodeByMd5(String string) throws NoSuchAlgorithmException, UnsupportedEncodingException {
// 确定计算方法
MessageDigest md5 = MessageDigest.getInstance("MD5");
Base64.Encoder base64Encoder = Base64.getEncoder();
// 加密字符串
return base64Encoder.encodeToString(md5.digest(string.getBytes("utf-8")));
}
}
标签:except coder 方法 encode odi algorithm get dig encrypt
原文地址:https://www.cnblogs.com/vincenshen/p/10427899.html