Files
git.stella-ops.org/src/Scanner/__Libraries/StellaOps.Scanner.ChangeTrace/ByteDiff/ByteDiffOptions.cs
2026-01-12 12:24:17 +02:00

58 lines
1.7 KiB
C#

// Copyright (c) StellaOps. All rights reserved.
// Licensed under AGPL-3.0-or-later. See LICENSE in the project root.
using System.Collections.Immutable;
namespace StellaOps.Scanner.ChangeTrace.ByteDiff;
/// <summary>
/// Options for byte-level diffing.
/// </summary>
public sealed record ByteDiffOptions
{
/// <summary>
/// Rolling hash window size in bytes. Default: 2048.
/// </summary>
public int WindowSize { get; init; } = 2048;
/// <summary>
/// Step size for window advancement. Default: WindowSize (non-overlapping).
/// </summary>
public int StepSize { get; init; } = 2048;
/// <summary>
/// Maximum file size to analyze in bytes. Default: 10MB.
/// </summary>
public long MaxFileSize { get; init; } = 10 * 1024 * 1024;
/// <summary>
/// Whether to analyze by ELF/PE section. Default: true.
/// </summary>
public bool AnalyzeBySections { get; init; } = true;
/// <summary>
/// Sections to include (e.g., ".text", ".data"). Null = all sections.
/// </summary>
public ImmutableArray<string>? IncludeSections { get; init; }
/// <summary>
/// Whether to include context description in output. Default: false.
/// </summary>
public bool IncludeContext { get; init; } = false;
/// <summary>
/// Enable parallel processing for large files. Default: true.
/// </summary>
public bool EnableParallel { get; init; } = true;
/// <summary>
/// Minimum number of consecutive changed windows to report. Default: 1.
/// </summary>
public int MinConsecutiveChanges { get; init; } = 1;
/// <summary>
/// Create default options.
/// </summary>
public static ByteDiffOptions Default { get; } = new();
}