zoukankan
html css js c++ java
MD5加密的两种方式笔记。
第一种方式是使用:
System.Web.Security空间下的相应类和方法加密,示例:
public
string
GetMD5(
string
s,
int
len)
{
return
FormsAuthentication.HashPasswordForStoringInConfigFile(s,
"
MD5
"
).Substring(
0
,len).ToLower();
}
第二种方式:
public
string
GetMD5(
string
s,
int
len)
{
System.Security.Cryptography.MD5 md5
=
System.Security.Cryptography.MD5.Create();
byte
[] bytes
=
System.Text.Encoding.UTF8.GetBytes(s);
bytes
=
md5.ComputeHash(bytes);
return
System.BitConverter.ToString(buffer).Replace(
"
-
"
,
""
).Substring(
0
,len).ToLower();
}
<h3>
心静似高山流水不动,心清若巫峰雾气不沾。
</h3>
查看全文
相关阅读:
Scoket简介
AOP
Windows服务
Nginx 教程 (1):基本概念
异步编程
并发编程
常用排序
序列化
MSBuild/Projectjson
不汇报是职场发展的绊脚石
原文地址:https://www.cnblogs.com/McJeremy/p/1212600.html
最新文章
CSS box-sizing
URL组成
时间 时区
文字字数限制 省略号
邮件支持的CSS
小程序测试经验总结
接口自动化测试HttpClient-基础篇2-Post请求
接口自动化测试HttpClient-基础篇1-Get请求
安全测试工具之AppScan(Application)
UI自动化测试POM设计之-maven工程
热门文章
UI自动化测试POM设计之-小demo
安全测试工具之OpenVAS(Server)
UI自动化测试POM设计之-思路结构
python添加默认模块搜索路径
接口自动化测试Python(3)_使用python对Json进行操作
Asp.net core
Json 简介
MIME 类型
SQL 语句基础
Linq
Copyright © 2011-2022 走看看