diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildBundleInfo.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildBundleInfo.cs index c9b087d9..fee3181c 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildBundleInfo.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildBundleInfo.cs @@ -27,7 +27,7 @@ namespace YooAsset.Editor /// /// 文件哈希值 /// - public string PackageFileCRC { set; get; } + public uint PackageFileCRC { set; get; } /// /// 文件哈希值 diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BaseTasks/TaskUpdateBundleInfo.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BaseTasks/TaskUpdateBundleInfo.cs index 2889381a..ffcd2979 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BaseTasks/TaskUpdateBundleInfo.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BaseTasks/TaskUpdateBundleInfo.cs @@ -63,7 +63,7 @@ namespace YooAsset.Editor protected abstract string GetUnityHash(BuildBundleInfo bundleInfo, BuildContext context); protected abstract uint GetUnityCRC(BuildBundleInfo bundleInfo, BuildContext context); protected abstract string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext); - protected abstract string GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext); + protected abstract uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext); protected abstract long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext); } } \ No newline at end of file diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BuiltinBuildPipeline/BuildTasks/TaskUpdateBundleInfo_BBP.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BuiltinBuildPipeline/BuildTasks/TaskUpdateBundleInfo_BBP.cs index 96f26f6a..f6bbfff7 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BuiltinBuildPipeline/BuildTasks/TaskUpdateBundleInfo_BBP.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BuiltinBuildPipeline/BuildTasks/TaskUpdateBundleInfo_BBP.cs @@ -45,10 +45,10 @@ namespace YooAsset.Editor string filePath = bundleInfo.PackageSourceFilePath; return HashUtility.FileMD5(filePath); } - protected override string GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) + protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) { string filePath = bundleInfo.PackageSourceFilePath; - return HashUtility.FileCRC32(filePath); + return HashUtility.FileCRC32Value(filePath); } protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) { diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/EditorSimulateBuildPipeline/BuildTasks/TaskUpdateBundleInfo_ESBP.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/EditorSimulateBuildPipeline/BuildTasks/TaskUpdateBundleInfo_ESBP.cs index 5d2745fa..7bb7bbfd 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/EditorSimulateBuildPipeline/BuildTasks/TaskUpdateBundleInfo_ESBP.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/EditorSimulateBuildPipeline/BuildTasks/TaskUpdateBundleInfo_ESBP.cs @@ -24,9 +24,9 @@ namespace YooAsset.Editor string filePath = bundleInfo.PackageSourceFilePath; return GetFilePathTempHash(filePath); } - protected override string GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) + protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) { - return "00000000"; //8位 + return 0; } protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) { diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/RawFileBuildPipeline/BuildTasks/TaskUpdateBundleInfo_RFBP.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/RawFileBuildPipeline/BuildTasks/TaskUpdateBundleInfo_RFBP.cs index d68c14c8..367662ad 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/RawFileBuildPipeline/BuildTasks/TaskUpdateBundleInfo_RFBP.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/RawFileBuildPipeline/BuildTasks/TaskUpdateBundleInfo_RFBP.cs @@ -27,10 +27,10 @@ namespace YooAsset.Editor string filePath = bundleInfo.PackageSourceFilePath; return HashUtility.FileMD5(filePath); } - protected override string GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) + protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) { string filePath = bundleInfo.PackageSourceFilePath; - return HashUtility.FileCRC32(filePath); + return HashUtility.FileCRC32Value(filePath); } protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) { diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/ScriptableBuildPipeline/BuildTasks/TaskUpdateBundleInfo_SBP.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/ScriptableBuildPipeline/BuildTasks/TaskUpdateBundleInfo_SBP.cs index f94a716d..15af935a 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/ScriptableBuildPipeline/BuildTasks/TaskUpdateBundleInfo_SBP.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/ScriptableBuildPipeline/BuildTasks/TaskUpdateBundleInfo_SBP.cs @@ -45,10 +45,10 @@ namespace YooAsset.Editor string filePath = bundleInfo.PackageSourceFilePath; return HashUtility.FileMD5(filePath); } - protected override string GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) + protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) { string filePath = bundleInfo.PackageSourceFilePath; - return HashUtility.FileCRC32(filePath); + return HashUtility.FileCRC32Value(filePath); } protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext) { diff --git a/Assets/YooAsset/Editor/AssetBundleReporter/ReportBundleInfo.cs b/Assets/YooAsset/Editor/AssetBundleReporter/ReportBundleInfo.cs index 6ab6cdef..b36b3893 100644 --- a/Assets/YooAsset/Editor/AssetBundleReporter/ReportBundleInfo.cs +++ b/Assets/YooAsset/Editor/AssetBundleReporter/ReportBundleInfo.cs @@ -26,7 +26,7 @@ namespace YooAsset.Editor /// /// 文件校验码 /// - public string FileCRC; + public uint FileCRC; /// /// 文件大小(字节数) diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/DefaultCacheFileSystem.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/DefaultCacheFileSystem.cs index 5b21cfd2..1707beae 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/DefaultCacheFileSystem.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/DefaultCacheFileSystem.cs @@ -505,22 +505,22 @@ namespace YooAsset } private readonly BufferWriter _sharedBuffer = new BufferWriter(1024); - public void WriteBundleInfoFile(string filePath, string dataFileCRC, long dataFileSize) + public void WriteBundleInfoFile(string filePath, uint dataFileCRC, long dataFileSize) { using (FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.Read)) { _sharedBuffer.Clear(); - _sharedBuffer.WriteUTF8(dataFileCRC); + _sharedBuffer.WriteUInt32(dataFileCRC); _sharedBuffer.WriteInt64(dataFileSize); _sharedBuffer.WriteToStream(fs); fs.Flush(); } } - public void ReadBundleInfoFile(string filePath, out string dataFileCRC, out long dataFileSize) + public void ReadBundleInfoFile(string filePath, out uint dataFileCRC, out long dataFileSize) { byte[] binaryData = FileUtility.ReadAllBytes(filePath); BufferReader buffer = new BufferReader(binaryData); - dataFileCRC = buffer.ReadUTF8(); + dataFileCRC = buffer.ReadUInt32(); dataFileSize = buffer.ReadInt64(); } #endregion diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/RecordFileElement.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/RecordFileElement.cs index 6331b1e2..2df75328 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/RecordFileElement.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/RecordFileElement.cs @@ -7,10 +7,10 @@ namespace YooAsset { public string InfoFilePath { private set; get; } public string DataFilePath { private set; get; } - public string DataFileCRC { private set; get; } + public uint DataFileCRC { private set; get; } public long DataFileSize { private set; get; } - public RecordFileElement(string infoFilePath, string dataFilePath, string dataFileCRC, long dataFileSize) + public RecordFileElement(string infoFilePath, string dataFilePath, uint dataFileCRC, long dataFileSize) { InfoFilePath = infoFilePath; DataFilePath = dataFilePath; diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/TempFileElement.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/TempFileElement.cs index c62f8172..b3c69048 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/TempFileElement.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/TempFileElement.cs @@ -4,7 +4,7 @@ namespace YooAsset internal class TempFileElement { public string TempFilePath { private set; get; } - public string TempFileCRC { private set; get; } + public uint TempFileCRC { private set; get; } public long TempFileSize { private set; get; } /// @@ -12,7 +12,7 @@ namespace YooAsset /// public volatile int Result = 0; - public TempFileElement(string filePath, string fileCRC, long fileSize) + public TempFileElement(string filePath, uint fileCRC, long fileSize) { TempFilePath = filePath; TempFileCRC = fileCRC; diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/VerifyFileElement.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/VerifyFileElement.cs index f5d0c1c8..be6dba4d 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/VerifyFileElement.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Elements/VerifyFileElement.cs @@ -10,7 +10,7 @@ namespace YooAsset public string DataFilePath { private set; get; } public string InfoFilePath { private set; get; } - public string DataFileCRC; + public uint DataFileCRC; public long DataFileSize; /// diff --git a/Assets/YooAsset/Runtime/FileSystem/FileVerifyHelper.cs b/Assets/YooAsset/Runtime/FileSystem/FileVerifyHelper.cs index b1667c1d..b2633319 100644 --- a/Assets/YooAsset/Runtime/FileSystem/FileVerifyHelper.cs +++ b/Assets/YooAsset/Runtime/FileSystem/FileVerifyHelper.cs @@ -8,7 +8,7 @@ namespace YooAsset /// /// 文件校验 /// - public static EFileVerifyResult FileVerify(string filePath, long fileSize, string fileCRC, EFileVerifyLevel verifyLevel) + public static EFileVerifyResult FileVerify(string filePath, long fileSize, uint fileCRC, EFileVerifyLevel verifyLevel) { try { @@ -25,7 +25,7 @@ namespace YooAsset // 再验证文件CRC if (verifyLevel == EFileVerifyLevel.High) { - string crc = HashUtility.FileCRC32(filePath); + uint crc = HashUtility.FileCRC32Value(filePath); if (crc == fileCRC) return EFileVerifyResult.Succeed; else diff --git a/Assets/YooAsset/Runtime/ResourcePackage/ManifestDefine.cs b/Assets/YooAsset/Runtime/ResourcePackage/ManifestDefine.cs index f37396ac..9cbe829a 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/ManifestDefine.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/ManifestDefine.cs @@ -16,6 +16,6 @@ namespace YooAsset /// /// 文件格式版本 /// - public const string FileVersion = "2.3.1"; + public const string FileVersion = "2025.8.28"; } } \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/ResourcePackage/ManifestTools.cs b/Assets/YooAsset/Runtime/ResourcePackage/ManifestTools.cs index 65729273..e1b85f3b 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/ManifestTools.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/ManifestTools.cs @@ -89,7 +89,7 @@ namespace YooAsset buffer.WriteUTF8(packageBundle.BundleName); buffer.WriteUInt32(packageBundle.UnityCRC); buffer.WriteUTF8(packageBundle.FileHash); - buffer.WriteUTF8(packageBundle.FileCRC); + buffer.WriteUInt32(packageBundle.FileCRC); buffer.WriteInt64(packageBundle.FileSize); buffer.WriteBool(packageBundle.Encrypted); buffer.WriteUTF8Array(packageBundle.Tags); @@ -190,7 +190,7 @@ namespace YooAsset packageBundle.BundleName = buffer.ReadUTF8(); packageBundle.UnityCRC = buffer.ReadUInt32(); packageBundle.FileHash = buffer.ReadUTF8(); - packageBundle.FileCRC = buffer.ReadUTF8(); + packageBundle.FileCRC = buffer.ReadUInt32(); packageBundle.FileSize = buffer.ReadInt64(); packageBundle.Encrypted = buffer.ReadBool(); packageBundle.Tags = buffer.ReadUTF8Array(); diff --git a/Assets/YooAsset/Runtime/ResourcePackage/Operation/Internal/DeserializeManifestOperation.cs b/Assets/YooAsset/Runtime/ResourcePackage/Operation/Internal/DeserializeManifestOperation.cs index 5ab3f406..91267649 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/Operation/Internal/DeserializeManifestOperation.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/Operation/Internal/DeserializeManifestOperation.cs @@ -159,7 +159,7 @@ namespace YooAsset packageBundle.BundleName = _buffer.ReadUTF8(); packageBundle.UnityCRC = _buffer.ReadUInt32(); packageBundle.FileHash = _buffer.ReadUTF8(); - packageBundle.FileCRC = _buffer.ReadUTF8(); + packageBundle.FileCRC = _buffer.ReadUInt32(); packageBundle.FileSize = _buffer.ReadInt64(); packageBundle.Encrypted = _buffer.ReadBool(); packageBundle.Tags = _buffer.ReadUTF8Array(); diff --git a/Assets/YooAsset/Runtime/ResourcePackage/PackageBundle.cs b/Assets/YooAsset/Runtime/ResourcePackage/PackageBundle.cs index 89d36857..388263f8 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/PackageBundle.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/PackageBundle.cs @@ -25,7 +25,7 @@ namespace YooAsset /// /// 文件校验码 /// - public string FileCRC; + public uint FileCRC; /// /// 文件大小(字节数)