- **YAML-driven, no code required**: you don't write the perfect hash tables by hand you list your keys (and optionally values) in a YAML file, run the EA once, and it generates the `.mqh` for you.
- **Two swappable hash stages**, matching how [PerfectHashByLeo](https://forge.mql5.io/nique_372/PerfectHashByLeo) works internally: a bucket hash (FNV-1a 64 or xxHash64) followed by a final displacement hash (MurMur-style, SplitMix64, fmix64 or Fibonacci hashing).
- **Two output modes**: either a table of **final values** (the generated function returns your mapped value directly) or a table of **indices** (the function returns a position into your own array useful when the value is too complex to inline).
2026-08-01 18:44:11 -05:00
- **Optional binary export**: alongside the `.mqh`, you can dump the seeds/hashes/values/meta as raw `.bin` files (useful if you want to load the table at runtime instead of compiling it in).
- **Generates a complete, working lookup function** both a `string`-keyed overload and a pre-hashed `ulong`-keyed overload, so callers who already computed the hash elsewhere can skip re-hashing.
Every parameter accepted by the YAML config is documented, with a ready-to-copy template, in **[Src/Template/README.md](./Src/Template/README.md)**.
---
## Usage: the process
**1. Write your YAML config** list your keys, pick your hash stages, point `file_name_out` at the `.mqh` you want generated. Full parameter reference: [Src/Template/README.md](./Src/Template/README.md).
**2. Run `SimpHash.mq5`** pointing `InpYamlFileName` at that config. It generates the `.mqh` with the seed/hash/value tables plus a ready `HashCustom(const string& key)` / `HashCustom(const ulong key_hash)` function:
- **Install them with `tsndep`** (available on [PyPI](https://pypi.org/project/tsndep)) from your `Shared Projects` folder it reads [dependencies.json](./dependencies.json) and downloads everything declared there:
1. Download the latest compiled EA from [Releases](https://forge.mql5.io/nique_372/SimPHash/releases) and move it into your terminal's `MQL5/Experts` folder.
2. Clone the [`TsnTables`](https://forge.mql5.io/nique_372/TsnTables.git) repository into your `Include` folder the generated `.mqh` includes it (e.g. `#include <TSN/Tables/AllHashes.mqh>`) to resolve the shared hash tables. See the [MqlIncludes convention](https://forge.mql5.io/nique_372/TSNReposIndex/src/branch/main/Conventions/MqlIncludes.md) for how these proxy includes work.
1. Get **SimPHash** from the [MQL5 Market](https://www.mql5.com/en/market/product/194416) it installs directly into your terminal, no moving files around.
2. Clone the [`TsnTables`](https://forge.mql5.io/nique_372/TsnTables.git) repository into your `Include` folder, same as in Option A.