diff --git a/src/BizHawk.Common/checksums/CRC32Checksum.cs b/src/BizHawk.Common/checksums/CRC32Checksum.cs deleted file mode 100644 index a988b4b803..0000000000 --- a/src/BizHawk.Common/checksums/CRC32Checksum.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -using BizHawk.Common.BufferExtensions; - -namespace BizHawk.Common -{ - /// uses custom implementation of CRC-32 (i.e. POSIX cksum) - /// - /// - /// - public static class CRC32Checksum - { - /// in bits - internal const int EXPECTED_LENGTH = 32; - - internal const string PREFIX = "CRC32"; - - public static byte[] BytesAsDigest(uint digest) - { - var a = BitConverter.GetBytes(digest); - return new[] { a[3], a[2], a[1], a[0] }; - } - - public static byte[] Compute(ReadOnlySpan data) - => BytesAsDigest(CRC32.Calculate(data)); - - public static string ComputeDigestHex(ReadOnlySpan data) - => Compute(data).BytesToHexString(); - - public static string ComputePrefixedHex(ReadOnlySpan data) - => $"{PREFIX}:{ComputeDigestHex(data)}"; - } -} diff --git a/src/BizHawk.Common/checksums/MD5Checksum.cs b/src/BizHawk.Common/checksums/MD5Checksum.cs index 5ccfcf817e..bff4627401 100644 --- a/src/BizHawk.Common/checksums/MD5Checksum.cs +++ b/src/BizHawk.Common/checksums/MD5Checksum.cs @@ -7,7 +7,6 @@ using BizHawk.Common.BufferExtensions; namespace BizHawk.Common { /// uses implementation from BCL - /// /// /// public static class MD5Checksum diff --git a/src/BizHawk.Common/checksums/SHA1Checksum.cs b/src/BizHawk.Common/checksums/SHA1Checksum.cs index 671dbf00c4..b9bb59a428 100644 --- a/src/BizHawk.Common/checksums/SHA1Checksum.cs +++ b/src/BizHawk.Common/checksums/SHA1Checksum.cs @@ -7,7 +7,6 @@ using BizHawk.Common.BufferExtensions; namespace BizHawk.Common { /// uses implementation from BCL - /// /// /// public static class SHA1Checksum diff --git a/src/BizHawk.Common/checksums/SHA256Checksum.cs b/src/BizHawk.Common/checksums/SHA256Checksum.cs index 63199db60d..ab0fb2904c 100644 --- a/src/BizHawk.Common/checksums/SHA256Checksum.cs +++ b/src/BizHawk.Common/checksums/SHA256Checksum.cs @@ -7,7 +7,6 @@ using BizHawk.Common.BufferExtensions; namespace BizHawk.Common { /// uses implementation from BCL - /// /// /// public static class SHA256Checksum diff --git a/src/BizHawk.Emulation.Common/Database/Database.cs b/src/BizHawk.Emulation.Common/Database/Database.cs index 229d337bc7..b8106f81e8 100644 --- a/src/BizHawk.Emulation.Common/Database/Database.cs +++ b/src/BizHawk.Emulation.Common/Database/Database.cs @@ -190,7 +190,7 @@ namespace BizHawk.Emulation.Common { acquire.WaitOne(); - var hashCRC32 = CRC32Checksum.ComputeDigestHex(romData); + var hashCRC32 = CRC32.Calculate(romData).ToString("X8"); if (DB.TryGetValue(hashCRC32, out var cgi)) { return new GameInfo(cgi); diff --git a/src/BizHawk.Emulation.DiscSystem/DiscHasher.cs b/src/BizHawk.Emulation.DiscSystem/DiscHasher.cs index b0657d252f..39bceb3621 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscHasher.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscHasher.cs @@ -54,7 +54,7 @@ namespace BizHawk.Emulation.DiscSystem crc.Add(buffer2352); } - return CRC32Checksum.BytesAsDigest(crc.Result).BytesToHexString(); + return crc.Result.ToString("X8"); } /// @@ -102,4 +102,4 @@ namespace BizHawk.Emulation.DiscSystem return "no data track found"; } } -} \ No newline at end of file +}