初始化
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
|
||||
namespace BLV_API
|
||||
{
|
||||
public static class Tools
|
||||
{
|
||||
public static string MD5Encrypt(string strEnc)
|
||||
{
|
||||
string result;
|
||||
try
|
||||
{
|
||||
MD5 md5Hasher = MD5.Create();
|
||||
byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(strEnc));
|
||||
StringBuilder sBuilder = new StringBuilder();
|
||||
int num;
|
||||
for (int i = 0; i < data.Length; i = num + 1)
|
||||
{
|
||||
sBuilder.Append(data[i].ToString("x2"));
|
||||
num = i;
|
||||
}
|
||||
result = sBuilder.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user