using System;
namespace NHSE.Core;
///
/// Specifies the region that a validation hash is calculated over.
///
/// Offset of the calculated hash.
/// Length of the hashed data.
public readonly record struct FileHashRegion(int HashOffset, int Length)
{
///
/// Offset where the data to be hashed starts at (calculated).
///
public int BeginOffset => HashOffset + 4;
///
/// Offset where the data to be hashed ends at (calculated), exclusive.
///
public int EndOffset => BeginOffset + Length;
public Range HashedRange => BeginOffset..EndOffset;
public override string ToString() => $"0x{HashOffset:X}: (0x{BeginOffset:X}-0x{EndOffset:X})";
}