NHSE/NHSE.Core/Hashing/FileHashRegion.cs
2026-01-13 16:02:58 -06:00

21 lines
723 B
C#

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