init commit all code
This commit is contained in:
25
Test/Getf.Service.Transfer.Request.SDK/Helpers/Md5Helper.cs
Normal file
25
Test/Getf.Service.Transfer.Request.SDK/Helpers/Md5Helper.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Getf.Service.Transfer.Request.SDK.Helpers
|
||||
{
|
||||
public static class Md5Helper
|
||||
{
|
||||
public static string Md5(string str)
|
||||
{
|
||||
MD5 md5 = MD5.Create();
|
||||
byte[] data = Encoding.UTF8.GetBytes(str);
|
||||
data = md5.ComputeHash(data);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
sb.Append(data[i].ToString("x2"));
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user