# Architecture HashTool is a .NET 10 solution with three shipped programs sharing one core library. ``` src/HashTool.Core hashing, checksum files, folder walking, settings (no UI; trim/AOT compatible) src/HashTool.App Avalonia 12 desktop app (CheckHash.exe) — views, view models, services src/HashTool.Cli `hashtool` command-line tool (System.CommandLine, NativeAOT) tests/ Core.Tests, Cli.Tests, App.Tests (Avalonia headless); Compat/LegacyClient (release gate) bench/ BenchmarkDotNet benchmarks (run by hand) eng/ scripts used by CI and releases (translations, coverage, release notes, package checks) build/ packaging inputs (macOS Info.plist, Linux icon) ``` Shared build settings: `Directory.Build.props` (version, nullable, analyzers, NuGet audit), `Directory.Packages.props` (central package versions with transitive pinning), `global.json` (SDK and the Microsoft.Testing.Platform runner), `.config/dotnet-tools.json` (vpk, nuget-license, CycloneDX, SonarScanner for .NET, dotnet-coverage; Dependabot keeps them up to date). ## HashTool.Core | Area | Types | Notes | |---|---|---| | Hashing | `HashEngine`, `HashType`, `HashAlgorithms`, `HashResult`, `HashMatcher`, `TextHashing` | One read per file for any number of algorithms: double-buffered reads (1 MiB, 4 MiB above 1 GiB), each block fed to every algorithm in parallel; BLAKE3 uses its multi-threaded update for large blocks. CRC32 is big-endian (as 7-Zip/SFV); `HashMatcher` still accepts the reversed order Hash Tool 1.1 wrote. `TextHashing` turns text into the bytes the Hash Text page and `hashtool hash -` hash: UTF-8/UTF-16 without a byte order mark, LF or CRLF line breaks, nothing appended. | | Checksum files | `ChecksumParser`, `ChecksumWriter`, `ChecksumDocument`, `ChecksumFileNames` | Reads GNU (`hash name`, `*name`, escaped names), BSD tagged, SFV, xxhsum `XXH3_` and bare sidecar hashes; writes GNU/BSD/SFV/JSON/CSV. The algorithm comes from the line, then the file name, then the user's choice, then the hash length. Paths may not point to UNC or device locations; CSV output neutralises formulas. | | Files | `FileEnumerator`, `FileErrors` | Walks folders without following symbolic links or junctions, skips unreadable folders, optionally hidden files. | | Processing | `BatchProcessor`, `HashJob`, `IHashJobObserver` | Small files in parallel (default `min(cores, 4)`), files ≥ 1 GiB in a separate lane, one at a time in HDD mode; per-file time-out; every item is reported exactly once. | | Configuration | `AppSettings`, `SettingsStore` | `config.json` with a schema version; atomic writes (temp file + move), values clamped on load, a corrupt file is backed up as `config.json.bak-