style : The hash utility class is exposed

pull/241/merge
hevinci 2024-02-21 10:10:37 +08:00
parent 0a7a883aae
commit 4170c60f0c
4 changed files with 6 additions and 11 deletions

View File

@ -496,14 +496,6 @@ namespace YooAsset.Editor
return fileInfo.Length;
}
/// <summary>
/// 获取文件的哈希值
/// </summary>
public static string GetFileCRC32(string filePath)
{
return HashUtility.FileCRC32(filePath);
}
/// <summary>
/// 读取文件的所有文本内容
/// </summary>

View File

@ -413,6 +413,9 @@ namespace YooAsset
return operation;
}
/// <summary>
/// 获取指定版本的缓存信息
/// </summary>
public GetAllCacheFileInfosOperation GetAllCacheFileInfosAsync(string packageVersion)
{
DebugCheckInitialize();

View File

@ -191,7 +191,7 @@ namespace YooAsset
/// <summary>
/// 哈希工具类
/// </summary>
internal static class HashUtility
public static class HashUtility
{
private static string ToString(byte[] hashBytes)
{

View File

@ -31,7 +31,7 @@ public sealed class StreamingAssetsHelper
{
if (GameQueryServices.CompareFileCRC)
{
string crc32 = YooAsset.Editor.EditorTools.GetFileCRC32(filePath);
string crc32 = YooAsset.HashUtility.FileCRC32(filePath);
return crc32 == fileCRC;
}
else
@ -146,7 +146,7 @@ internal class PreprocessBuild : UnityEditor.Build.IPreprocessBuildWithReport
BuildinFileManifest.Element element = new BuildinFileManifest.Element();
element.PackageName = fileInfo.Directory.Name;
element.FileCRC32 = YooAsset.Editor.EditorTools.GetFileCRC32(fileInfo.FullName);
element.FileCRC32 = YooAsset.HashUtility.FileCRC32(fileInfo.FullName);
element.FileName = fileInfo.Name;
manifest.BuildinFiles.Add(element);
}