Start introducing concept of internal hashes

This commit is contained in:
Matt Nadareski
2025-01-05 21:11:14 -05:00
parent 39f02b3ee1
commit fe78a5532f
6 changed files with 175 additions and 140 deletions

View File

@@ -1,5 +1,5 @@
using System.IO;
using System.Text;
using SabreTools.IO.Extensions;
namespace SabreTools.FileTypes.Aaru
{
@@ -25,19 +25,12 @@ namespace SabreTools.FileTypes.Aaru
{
var checksumEntry = new ChecksumEntry();
#if NET20 || NET35 || NET40
using (var br = new BinaryReader(stream, Encoding.Default))
#else
using (var br = new BinaryReader(stream, Encoding.Default, true))
#endif
{
checksumEntry.type = (AaruChecksumAlgorithm)br.ReadByte();
checksumEntry.length = br.ReadUInt32();
if (checksumEntry.length == 0)
return null;
checksumEntry.type = (AaruChecksumAlgorithm)stream.ReadByteValue();
checksumEntry.length = stream.ReadUInt32();
if (checksumEntry.length == 0)
return null;
checksumEntry.checksum = br.ReadBytes((int)checksumEntry.length);
}
checksumEntry.checksum = stream.ReadBytes((int)checksumEntry.length);
return checksumEntry;
}