public class MD5Utils {
public static String encodeByMd5(String message) {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
String newMessage = Base64.getEncoder().encodeToString(md5.digest(message.getBytes("utf-8")));
return newMessage;
}
} catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
return null;
}
}
12-07
175
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-05
4188
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交