-
java MD5工具类
- package com.common.tools;
-
- import java.security.MessageDigest;
-
- public abstract class MD5Tools
- {
- public final static String MD5(String pwd) {
-
- char md5String[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- 'A', 'B', 'C', 'D', 'E', 'F' };
- try {
-
- byte[] btInput = pwd.getBytes();
-
-
- MessageDigest mdInst = MessageDigest.getInstance("MD5");
-
-
- mdInst.update(btInput);
-
-
- byte[] md = mdInst.digest();
-
-
- int j = md.length;
- char str[] = new char[j * 2];
- int k = 0;
- for (int i = 0; i < j; i++) {
- byte byte0 = md[i];
- str[k++] = md5String[byte0 >>> 4 & 0xf];
- str[k++] = md5String[byte0 & 0xf];
- }
-
-
- return new String(str);
-
- } catch (Exception e) {
- return null;
- }
- }
- }
- 转自http://blog.csdn.net/clj198606061111/article/details/39722781
-
相关阅读:
Core Data Migration 之拆分Entity
Core Data Migration 之拆分Entity
对 Android 开发者有益的 40 条优化建议
对 Android 开发者有益的 40 条优化建议
超实用的Java数组技巧攻略分享!
ls command not found
苹果建议开发者在iOS 7正式发布之前把应用提交至App Store
关于android SDK安装Failed to fetch URL http://dl-ssl.google.com/android/repository/addons_list-1.xml出错
Linux_系统时间管理
Python_元组、字典内建方法详解
-
原文地址:https://www.cnblogs.com/shizhijie/p/8267513.html
Copyright © 2020-2023
润新知