using System; using System.IO; using System.Security.Cryptography; namespace Kingo.Plugin.EngineEditor.Common { public class FileHash { public static string GetHash(string path) { //var hash = SHA256.Create(); //var hash = MD5.Create(); var hash = SHA1.Create(); var stream = new FileStream(path, FileMode.Open); byte[] hashByte = hash.ComputeHash(stream); stream.Close(); return BitConverter.ToString(hashByte).Replace("-", ""); } } }