From 52871ad0093ffda77e5f69dc8c99792582dafd60 Mon Sep 17 00:00:00 2001 From: 13xforever Date: Fri, 16 Feb 2024 21:41:18 +0500 Subject: [PATCH] upgrade dependencies replace crc32 hashing with standard package --- Clients/CirrusCiClient/CirrusCiClient.csproj | 2 +- .../CompatApiClient/CompatApiClient.csproj | 4 +- Clients/GithubClient/GithubClient.csproj | 2 +- .../IrdLibraryClient/IrdFormat/IrdParser.cs | 5 ++- .../IrdLibraryClient/IrdLibraryClient.csproj | 6 +-- Clients/PsnClient/PsnClient.csproj | 2 +- CompatBot/CompatBot.csproj | 38 +++++++++---------- Tests/Tests.csproj | 4 +- 8 files changed, 32 insertions(+), 31 deletions(-) diff --git a/Clients/CirrusCiClient/CirrusCiClient.csproj b/Clients/CirrusCiClient/CirrusCiClient.csproj index 35b18f21..fe42b3e0 100644 --- a/Clients/CirrusCiClient/CirrusCiClient.csproj +++ b/Clients/CirrusCiClient/CirrusCiClient.csproj @@ -11,6 +11,6 @@ - + \ No newline at end of file diff --git a/Clients/CompatApiClient/CompatApiClient.csproj b/Clients/CompatApiClient/CompatApiClient.csproj index 8dcd4401..d7eab5a6 100644 --- a/Clients/CompatApiClient/CompatApiClient.csproj +++ b/Clients/CompatApiClient/CompatApiClient.csproj @@ -16,8 +16,8 @@ - - + + diff --git a/Clients/GithubClient/GithubClient.csproj b/Clients/GithubClient/GithubClient.csproj index 6a75bf67..14e0dae2 100644 --- a/Clients/GithubClient/GithubClient.csproj +++ b/Clients/GithubClient/GithubClient.csproj @@ -6,7 +6,7 @@ - + diff --git a/Clients/IrdLibraryClient/IrdFormat/IrdParser.cs b/Clients/IrdLibraryClient/IrdFormat/IrdParser.cs index e78e7e34..cf2d4e92 100644 --- a/Clients/IrdLibraryClient/IrdFormat/IrdParser.cs +++ b/Clients/IrdLibraryClient/IrdFormat/IrdParser.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.IO; using System.IO.Compression; +using System.IO.Hashing; using System.Text; using CompatApiClient; -using Force.Crc32; namespace IrdLibraryClient.IrdFormat; @@ -70,7 +70,8 @@ public static Ird Parse(byte[] content) result.Uid = reader.ReadInt32(); var dataLength = reader.BaseStream.Position; result.Crc32 = reader.ReadUInt32(); - var crc32 = Crc32Algorithm.Compute(content, 0, (int)dataLength); + var crc32Bytes = Crc32.Hash(content.AsSpan(0, (int)dataLength)); + var crc32 = BitConverter.ToUInt32(crc32Bytes); if (result.Crc32 != crc32) throw new InvalidDataException($"Corrupted IRD data, expected {result.Crc32:x8}, but was {crc32:x8}"); return result; diff --git a/Clients/IrdLibraryClient/IrdLibraryClient.csproj b/Clients/IrdLibraryClient/IrdLibraryClient.csproj index 301f731a..fb910fc5 100644 --- a/Clients/IrdLibraryClient/IrdLibraryClient.csproj +++ b/Clients/IrdLibraryClient/IrdLibraryClient.csproj @@ -5,10 +5,10 @@ enable - - - + + + diff --git a/Clients/PsnClient/PsnClient.csproj b/Clients/PsnClient/PsnClient.csproj index 2cb1ee58..4cef8077 100644 --- a/Clients/PsnClient/PsnClient.csproj +++ b/Clients/PsnClient/PsnClient.csproj @@ -12,7 +12,7 @@ - + diff --git a/CompatBot/CompatBot.csproj b/CompatBot/CompatBot.csproj index 03d9ac18..695463c2 100644 --- a/CompatBot/CompatBot.csproj +++ b/CompatBot/CompatBot.csproj @@ -39,36 +39,36 @@ - - - - - + + + + + - - - + + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + - + - - + + - - - + + + diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index ec718351..7a065a2c 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -7,12 +7,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive