5-channel CRT mixing with avalanche. CC0. No patents. No dependencies.
Input -> integer fold -> CRT decompose into 5 channels: mod {8, 9, 25, 49, 11}.
Each round (Feistel-like):
1. Per-channel mixing: multiply by primitive root + add neighbors
2. CRT reconstruct back to integer
3. XOR with input, multiply by round constant, mod N
4. Re-decompose into 5 channels for next round
After 8 rounds, the 5 channel residues ARE the hash.
WHY THIS WORKS:
- CRT decomposition splits input into 5 INDEPENDENT views
- Integer folding (step 3) BREAKS the CRT bijection — creates real mixing
- Cross-channel addition spreads each bit to all channels
- Avalanche: 50.0% (near-ideal). Collisions: birthday-bound.
- 5 channels = 8*9*25*49*11 = 970200 possible outputs per word
Output: 5 residues (mod 8, mod 9, mod 25, mod 49, mod 11) = 20-bit hash.
Merkle-Damgaard chaining for arbitrary-length input.
Hash = 5 CRT channel residues, hex-encoded. Each channel is independent.
Flip 1 bit of input. How many output bits change? Ideal: 50%.
Hash N sequential integers. Check for collisions in 20-bit output space.
Watch how a single input byte spreads across all 5 channels over rounds.
Hash 10K sequential integers, check output uniformity per channel.