MD5算法
来源:互联网 发布:渡边直美 知乎 编辑:程序博客网 时间:2024/06/05 07:24
public static String md5(String string) { byte[] hash; try { hash = MessageDigest.getInstance("MD5").digest(string.getBytes("UTF-8")); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("Huh, MD5 should be supported?", e); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Huh, UTF-8 should be supported?", e); } StringBuilder hex = new StringBuilder(hash.length * 2); for (byte b : hash) { if ((b & 0xFF) < 0x10) hex.append("0"); hex.append(Integer.toHexString(b & 0xFF)); } return hex.toString(); }
0 0
- MD5算法
- MD5 算法
- MD5算法
- MD5 算法
- MD5算法
- MD5算法
- MD5算法
- md5 算法
- MD5算法
- MD5算法
- MD5算法
- MD5算法
- md5算法
- MD5算法
- MD5算法
- md5算法
- MD5算法
- MD5算法
- 使用virtualenv, uwsgi, nginx来布署flask
- hdu 3599 War(最短路+最大流)
- json解析 本地文件和网上文件(通过接口)
- python_学习笔记0817
- C#接口详解
- MD5算法
- socket之广播
- poj-2503 Babelfish
- 给中国学生的第二封信:从优秀到卓越
- centos下vi的用法大全
- Codeforces Round #284 (Div. 1) C. Array and Operations (最大流)
- HEALTHY LIFE OPENCART 自适应主题模板 ABC-0133
- 《数据结构与算法分析》不相交集
- jQuery 表单数据序列化为json格式