zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Unity/Assets/Model/Core/Helper/MD5Helper.cs

20 lines
385 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using System.IO;
using System.Security.Cryptography;
namespace ET
{
public static class MD5Helper
{
public static string FileMD5(string filePath)
{
byte[] retVal;
using (FileStream file = new FileStream(filePath, FileMode.Open))
{
MD5 md5 = new MD5CryptoServiceProvider();
retVal = md5.ComputeHash(file);
}
return retVal.ToHex("x2");
}
}
}