Add and use SpamSum for Media and Rom types

SpamSum implementation courtesy of https://github.com/aaru-dps/Aaru
This commit is contained in:
Matt Nadareski
2020-09-04 15:02:15 -07:00
parent 40ca4e39a5
commit 5f749d07a4
26 changed files with 834 additions and 24 deletions

View File

@@ -75,6 +75,7 @@ namespace SabreTools.Library.DatFiles
SHA256 = (_hash.HasFlag(Hash.SHA256) ? hash : null),
SHA384 = (_hash.HasFlag(Hash.SHA384) ? hash : null),
SHA512 = (_hash.HasFlag(Hash.SHA512) ? hash : null),
SpamSum = (_hash.HasFlag(Hash.SpamSum) ? hash : null),
ItemStatus = ItemStatus.None,
Machine = new Machine
@@ -316,6 +317,24 @@ namespace SabreTools.Library.DatFiles
break;
}
break;
case Hash.SpamSum:
switch (datItem.ItemType)
{
case ItemType.Media:
var media = datItem as Media;
fields[0] = media.SpamSum;
fields[1] = name;
break;
case ItemType.Rom:
var rom = datItem as Rom;
fields[0] = rom.SpamSum;
fields[1] = name;
break;
}
break;
}