From 2b2ae8fa7be61dda8c400e8f8e86770238995ad1 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 9 Feb 2025 15:33:05 +0000 Subject: [PATCH] Made changes to `GenerateCrc32ForData` --- Libraries/Core/Services/Cache/BundleHashCacheService.cs | 4 ++-- Libraries/Core/Utils/HashUtil.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Libraries/Core/Services/Cache/BundleHashCacheService.cs b/Libraries/Core/Services/Cache/BundleHashCacheService.cs index c5e5d556..2870dbcd 100644 --- a/Libraries/Core/Services/Cache/BundleHashCacheService.cs +++ b/Libraries/Core/Services/Cache/BundleHashCacheService.cs @@ -43,7 +43,7 @@ public class BundleHashCacheService( public bool CalculateAndMatchHash(string bundlePath) { var fileContents = _fileUtil.ReadFile(bundlePath); - var generatedHash = _hashUtil.GenerateCrc32ForData(fileContents); + var generatedHash = _hashUtil.GenerateMd5ForData(fileContents); return MatchWithStoredHash(bundlePath, generatedHash); } @@ -51,7 +51,7 @@ public class BundleHashCacheService( public void CalculateAndStoreHash(string bundlePath) { var fileContents = _fileUtil.ReadFile(bundlePath); - var generatedHash = _hashUtil.GenerateCrc32ForData(fileContents); + var generatedHash = _hashUtil.GenerateMd5ForData(fileContents); StoreValue(bundlePath, generatedHash); } diff --git a/Libraries/Core/Utils/HashUtil.cs b/Libraries/Core/Utils/HashUtil.cs index 866e0517..adfed2f8 100644 --- a/Libraries/Core/Utils/HashUtil.cs +++ b/Libraries/Core/Utils/HashUtil.cs @@ -64,6 +64,7 @@ public class HashUtil return GenerateHashForData(HashingAlgorithm.SHA1, data); } + [Obsolete("Use GenerateMd5ForData instead")] public string GenerateCrc32ForData(string data) { // TODO: Could not find a ms way of doing this.