MD5 .net与PHP加密值一样的加密代码

.net 代码

using System.Security.Cryptography;

/// <summary>
/// 返回大写形式的MD5加密
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public string Md5Upper(string input)
{
MD5 md5Hasher = MD5.Create();
byte[] data = md5Hasher.ComputeHash(Encoding.UTF8.GetBytes(input));
StringBuilder sBuilder = new StringBuilder();
for (int i = ; i < data.Length; i++)
{
sBuilder.Append(data[i].ToString("x2"));
}
return sBuilder.ToString().ToUpper();
}
上一篇:还在curd吗?封装属于自己的Spring-Boot-Starter


下一篇:error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2