From 8849134d50e428ea223951ac74ec0999650f5d45 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Fri, 19 Nov 2021 00:48:35 +1000 Subject: [PATCH] Flip endianness of CRC32 checksums --- src/BizHawk.Common/checksums/CRC32Checksum.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Common/checksums/CRC32Checksum.cs b/src/BizHawk.Common/checksums/CRC32Checksum.cs index 493d46fd67..a988b4b803 100644 --- a/src/BizHawk.Common/checksums/CRC32Checksum.cs +++ b/src/BizHawk.Common/checksums/CRC32Checksum.cs @@ -16,7 +16,10 @@ namespace BizHawk.Common internal const string PREFIX = "CRC32"; public static byte[] BytesAsDigest(uint digest) - => BitConverter.GetBytes(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));