04 2013 档案

摘要:public static string MD5Encrypt(string strText) { MD5 md5 = new MD5CryptoServiceProvider(); byte[] result = md5.ComputeHash(System.Text.Encoding.Default.GetBytes(strText)); return System.Text.Encoding.Default.GetString(result); } 阅读全文
posted @ 2013-04-27 10:15 S&L·chuck 阅读(178) 评论(0) 推荐(0) 编辑
摘要:public static string SHA256Hash(string input) { byte[] InputBytes = Encoding.Default.GetBytes(input); SHA256Managed sha256 = new SHA256Managed(); byte[] OutputBytes = sha256.ComputeHash(InputBytes); return Convert.ToBase64String(OutputBytes); } 阅读全文
posted @ 2013-04-27 10:09 S&L·chuck 阅读(242) 评论(0) 推荐(0) 编辑
摘要:public static finalString EncoderPwdByMd5(String str)throwsNoSuchAlgorithmException, UnsupportedEncodingException { MessageDigest md5 = MessageDigest.getInstance("MD5"); BASE64Encoder base64en =newBASE64Encoder(); String newstr = base64en.encode(md5.digest(str.getBytes("utf-8"))) 阅读全文
posted @ 2013-04-16 22:36 S&L·chuck 阅读(196) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示