diff --git a/Assets/CatAsset/Runtime/Misc/RuntimeUtil.cs b/Assets/CatAsset/Runtime/Misc/RuntimeUtil.cs index 2d3f4d4..eeab4fb 100644 --- a/Assets/CatAsset/Runtime/Misc/RuntimeUtil.cs +++ b/Assets/CatAsset/Runtime/Misc/RuntimeUtil.cs @@ -152,12 +152,20 @@ public static string GetFileMD5(string filePath) { using (FileStream fs = new FileStream(filePath,FileMode.Open)) { - using (MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider()) - { - byte[] bytes = md5.ComputeHash(fs); - string result = MD5BytesToString(bytes); - return result; - } + return GetFileMD5(fs); + } + } + + /// + /// 获取文件MD5 + /// + public static string GetFileMD5(FileStream fs) + { + using (MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider()) + { + byte[] bytes = md5.ComputeHash(fs); + string result = MD5BytesToString(bytes); + return result; } }