give more secure hashes higher priority than less secure ones

This commit is contained in:
CasualPokePlayer 2022-02-20 05:05:58 -08:00
parent d829f19bca
commit 9092a38a82
1 changed files with 4 additions and 4 deletions

View File

@ -220,8 +220,8 @@ namespace BizHawk.Emulation.Common
{
acquire.WaitOne();
var hashCRC32 = CRC32Checksum.ComputeDigestHex(romData);
if (DB.TryGetValue(hashCRC32, out var cgi))
var hashSHA1 = SHA1Checksum.ComputeDigestHex(romData);
if (DB.TryGetValue(hashSHA1, out var cgi))
{
return new GameInfo(cgi);
}
@ -232,8 +232,8 @@ namespace BizHawk.Emulation.Common
return new GameInfo(cgi);
}
var hashSHA1 = SHA1Checksum.ComputeDigestHex(romData);
if (DB.TryGetValue(hashSHA1, out cgi))
var hashCRC32 = CRC32Checksum.ComputeDigestHex(romData);
if (DB.TryGetValue(hashCRC32, out cgi))
{
return new GameInfo(cgi);
}