android MD5加密
16lz
2021-12-04
public class Demo {/** * @param args * @throws NoSuchAlgorithmException */public static void main(String[] args) throws NoSuchAlgorithmException {MessageDigest digest = MessageDigest.getInstance("md5");String password = "123456";byte [] bytes = digest.digest(password.getBytes());StringBuffer buffer = new StringBuffer();for(byte b: bytes){int number = b & 0xff;//加盐String hex = Integer.toHexString(number);if(hex.length()==1){buffer.append("0");}buffer.append(hex);}//md5加密后的值System.out.println(buffer);}}
版权声明:本文为博主原创文章,未经博主允许不得转载。
更多相关文章
- android开机启动代码
- Android(安卓)点击按钮,文本文字改变
- android studio
- Notes on the implementation of encryption in Android(安卓)3.
- AES加密解密Android版
- 如何在android画分析图(例如 柱状图、趋势图、饼图)
- android、ios与服务器端php使用rsa加密解密通讯
- Android(安卓)AES加密算法及事实上现
- Android入门第十六篇之Style与Theme