26 lines
531 B
C#
26 lines
531 B
C#
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();
|
|
}
|
|
}
|
|
}
|