Android md5加密工具类
发布日期:2021-06-30 22:37:05 浏览次数:2 分类:技术文章

本文共 648 字,大约阅读时间需要 2 分钟。

/** *  * @描述         md5加密工具类 * @项目名称      App_News * @包名         com.android.news.tools * @类名         MD5Encoder * @author      chenlin * @date        2012年5月19日 下午9:24:23 * @version     1.0 */public class MD5Encoder {
public static String encode(String string) throws Exception { byte[] hash = MessageDigest.getInstance("MD5").digest(string.getBytes("UTF-8")); 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(); }}

转载地址:https://lovoo.blog.csdn.net/article/details/51457210 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:C经典 联合体union
下一篇:OC 对象作为方法的参数连续传递

发表评论

最新留言

关注你微信了!
[***.104.42.241]2024年04月21日 11时37分23秒