Low-level base primitives for building fast parsers in MQL5: SWAR byte-scanning tricks, string hashing (FNV-1a, xxHash64),
lookup tables for hex decoding and float parsing without <code>pow()</code>, and fast integer-to-string helpers.<br/>
No external dependencies — pure MQL5, meant to be included directly by higher-level parsers (JSON, YAML, SetFile, etc.).
</p>
---
## Main Features
- **SWAR byte-scanning (`Swar.mqh`)**: bit-trick macros (`TSNTABLES_SWAR_HAS`) to check 8 packed bytes at once against a delimiter mask (`"`, `\`, `,`, `:`, `\n`, etc.), plus a De Bruijn lookup table (`g_table_i64`) to find which byte matched — the base technique for scanning structured-text formats a full machine word at a time instead of byte by byte.
- **String hashing (`PHash/`)**: FNV-1a 64-bit (`FNV1a_64`, plus inlineable `FNV1a_64_AsM_*` macros) and a full xxHash64 implementation (`XSTR::XXH64` for `string`, `XU::XXH64` for `uchar[]`) — same algorithm, two entry points depending on the buffer type.
- **Fast float parsing tables (`Exp.mqh` / `Pow.mqh`)**: precomputed `1e-308`..`1e308` tables (`g_Exp10`, `g_Pow10`) to convert exponents during string→double conversion without calling `MathPow()`.
- **Hex decoding table (`Hex.mqh`)**: 256-entry lookup (`g_arr_valid_hex_chars`) mapping ASCII to its hex nibble (or `0xFF` if invalid), for decoding `\xXX` / `\uXXXX` escapes.
- **Fast digit-pair table (`DPairs.mqh`)**: 200-entry table (`g_tsn_digit_pairs`) with pre-built two-digit strings `"00"`..`"99"`, for writing integers two digits at a time instead of one.
- **Escape/unescape sentinels (`EscapeUnescape.mqh`)**: shared sentinel codes (`0xFD` hex, `0xFE` unicode, `0xFF` invalid/passthrough) that define the contract consumers use when building their own escape tables.
### Usage examples
**Scan 8 bytes for a delimiter (SWAR):**
```mql5
#include <TsnTables\\Src\\Swar\\Swar.mqh>
ulong word; // 8 packed bytes read from the buffer
Requires the `tsndep` package, available on [PyPI](https://pypi.org/project/tsndep). It automatically downloads and installs all declared dependencies.
---
## Quick Start
**1. Include the module you need:**
```mql5
#include <TsnTables\\Src\\PHash\\AllHash.mqh>
```
**2. Use it:**
```mql5
ulong h = TSN::FNV1a_64("clave", 5);
```
---
## License
**[Read Full License](./LICENSE)**
By downloading or using this repository, you accept the license terms.