GitHub - M-Abozaid/esp32-c3-adblock: Pi-hole-class DNS ad-blocker on a $2 ESP32-C3 (no PSRAM): 537k domains as 40-bit FNV-1a hashes in flash, binary-searched. UDP DNS sinkhole + web dashboard. https://youtube.com/shorts/RaxszOUMi8E?feature=share
Pangram verdict · v3.3
We believe this text is mainly AI, with some human-written content.
AI likelihood · overall
AIArticle text · 183 words · 3 segments analyzed
日本語 README A Pi-hole-style DNS ad-blocker that runs on a $2 ESP32-C3 — no PSRAM required. 📰 Featured on Tom's Hardware, XDA Developers, and Korben.
The trick everyone misses: you don't need to keep the blocklist in RAM. Store the domains as sorted 40-bit hashes in flash and binary-search them. 140,000+ domains fit in ~0.7 MB of flash and are matched in ~10 ms, using ~50 KB of RAM. query in ──▶ extract domain ──▶ FNV-1a hash (+ parent suffixes) ──▶ binary-search the flash hash table ├─ hit ──▶ answer 0.0.0.0 (sinkholed) └─ miss ──▶ forward to upstream resolver, relay the reply Why this is interesting Most ESP32 DNS sinkholes load the blocklist (domain strings) into RAM, so they demand PSRAM.
This project stores fixed 5-byte (40-bit) hashes in flash instead: string-in-RAM approach this (hash-in-flash) Hardware ESP32 + PSRAM (~$8) ESP32-C3, no PSRAM (~$2) 141k domains ~2.5 MB of RAM 0.67 MB of flash RAM used most of it ~50 KB Lookup string compare ~18 flash reads (~10 ms incl. WiFi RTT) Collisions n/a 0 at 141k (1 at 537k) Why 40 bits?