# snowfish2871/ehsc- architecture

> Architecture diagram of the GitHub repository snowfish2871/ehsc-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/snowfish2871/ehsc-
- Repository: https://github.com/snowfish2871/ehsc-

## Overview

EHsc is a Windows command-line and interactive tool for hashing and checking files, implemented without external cryptographic libraries. The main workflow accepts command-line or menu input, resolves files or folders, computes selected digests, and presents or saves results; users can also verify manifests, compare files, benchmark algorithms, and monitor file activity. The README documents these capabilities and the layer design; sampled excerpts show several command-to-engine calls, but not every internal implementation link.

Main entry points: [`src/main.cpp`](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/main.cpp) (Commands and menu), [`src/core.cpp`](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp) (Hash jobs), [`src/watch.cpp`](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/watch.cpp) (File activity monitor), [`src/report.cpp`](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/report.cpp) (Manifest verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and interaction"]
  node_cli["Commands and menu<br/>[main.cpp]"]
  node_console["Console UI and config<br/>[ui.cpp]"]
end

subgraph group_engine["File processing"]
  node_job["Job control<br/>[core.cpp]"]
  node_scan["File and folder scan<br/>[core.cpp]"]
  node_hashjob["Hash jobs<br/>[core.cpp]"]
  node_compare["Byte comparison<br/>[core.cpp]"]
  node_benchmark["Algorithm benchmark<br/>[core.cpp]"]
end

subgraph group_outputs["Reports and monitoring"]
  node_reports["Manifest output<br/>[report.cpp]"]
  node_verify["Manifest verification<br/>[report.cpp]"]
  node_watch["File activity monitor<br/>[watch.cpp]"]
end

subgraph group_platform["Algorithms and Windows"]
  node_hashes["Hash algorithms<br/>[hashes.cpp]"]
  node_winapi["Windows utilities<br/>[win32_utils.cpp]"]
end

node_user(("User or script"))
node_filesystem[("Local files")]
node_processes(("Windows processes"))

node_user -->|"invokes"| node_cli
node_cli -->|"uses interface"| node_console
node_cli -->|"runs hash job"| node_hashjob
node_cli -->|"verifies manifest"| node_verify
node_cli -->|"compares files"| node_compare
node_cli -->|"runs benchmark"| node_benchmark
node_cli -->|"starts monitor"| node_watch
node_cli -->|"builds watch report"| node_reports
node_cli -.->|"controls tasks"| node_job
node_scan -.->|"enumerates"| node_filesystem
node_hashjob -.->|"scans targets"| node_scan
node_hashjob -.->|"computes digests"| node_hashes
node_hashjob -.->|"reads files"| node_filesystem
node_compare -.->|"reads bytes"| node_filesystem
node_benchmark -.->|"measures throughput"| node_hashes
node_verify -.->|"parses manifest"| node_reports
node_verify -.->|"recomputes digests"| node_hashjob
node_reports -.->|"writes output"| node_filesystem
node_watch -.->|"observes changes"| node_filesystem
node_watch -.->|"samples handles"| node_processes
node_cli -->|"uses platform services"| node_winapi
node_console -->|"uses console and dialogs"| node_winapi
node_watch -.->|"uses native APIs"| node_winapi

click node_cli "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/main.cpp"
click node_console "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/ui.cpp"
click node_job "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp"
click node_scan "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp"
click node_hashjob "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp"
click node_compare "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp"
click node_benchmark "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp"
click node_reports "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/report.cpp"
click node_verify "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/report.cpp"
click node_watch "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/watch.cpp"
click node_hashes "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/hashes.cpp"
click node_winapi "https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/win32_utils.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_console,node_user toneBlue
class node_job,node_scan,node_hashjob,node_compare,node_benchmark,node_filesystem toneAmber
class node_reports,node_verify,node_watch toneMint
class node_hashes,node_winapi toneRose
class node_processes toneIndigo
```

## Components

### Entry and interaction

- [Commands and menu](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/main.cpp): `src/main.cpp`
- [Console UI and config](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/ui.cpp): `src/ui.cpp`

### File processing

- [Job control](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp): `src/core.cpp`
- [File and folder scan](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp): `src/core.cpp`
- [Hash jobs](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp): `src/core.cpp`
- [Byte comparison](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp): `src/core.cpp`
- [Algorithm benchmark](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/core.cpp): `src/core.cpp`

### Reports and monitoring

- [Manifest output](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/report.cpp): `src/report.cpp`
- [Manifest verification](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/report.cpp): `src/report.cpp`
- [File activity monitor](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/watch.cpp): `src/watch.cpp`

### Algorithms and Windows

- [Hash algorithms](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/hashes.cpp): `src/hashes.cpp`
- [Windows utilities](https://github.com/snowfish2871/ehsc-/blob/2.1.1/src/win32_utils.cpp): `src/win32_utils.cpp`

### Other components

- **User or script**
- **Local files**
- **Windows processes**

## Connections

- User or script → Commands and menu: invokes (evidence: `README.md`)
- Commands and menu → Console UI and config: uses interface (evidence: `src/main.cpp`)
- Commands and menu → Hash jobs: runs hash job (evidence: `src/main.cpp`)
- Commands and menu → Manifest verification: verifies manifest (evidence: `src/main.cpp`)
- Commands and menu → Byte comparison: compares files (evidence: `src/main.cpp`)
- Commands and menu → Algorithm benchmark: runs benchmark (evidence: `src/main.cpp`)
- Commands and menu → File activity monitor: starts monitor (evidence: `src/main.cpp`)
- Commands and menu → Manifest output: builds watch report (evidence: `src/main.cpp`)
- Commands and menu → Job control: controls tasks
- File and folder scan → Local files: enumerates
- Hash jobs → File and folder scan: scans targets (evidence: `src/core.cpp`)
- Hash jobs → Hash algorithms: computes digests
- Hash jobs → Local files: reads files
- Byte comparison → Local files: reads bytes
- Algorithm benchmark → Hash algorithms: measures throughput
- Manifest verification → Manifest output: parses manifest (evidence: `src/report.cpp`)
- Manifest verification → Hash jobs: recomputes digests
- Manifest output → Local files: writes output
- File activity monitor → Local files: observes changes
- File activity monitor → Windows processes: samples handles
- Commands and menu → Windows utilities: uses platform services (evidence: `src/main.cpp`)
- Console UI and config → Windows utilities: uses console and dialogs (evidence: `src/ui.cpp`)
- File activity monitor → Windows utilities: uses native APIs
