Skip to content
HN On Hacker News ↗

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

▲ 192 points • 82 comments • by jayhoon • 3d ago • HN discussion ↗

Pangram verdict · v3.3

We believe this text is mainly AI, with some human-written content.

88 %

AI likelihood · overall

AI
5% human-written 95% AI-generated
SEGMENTS · HUMAN 0 of 3
SEGMENTS · AI 1 of 3
WORD COUNT 183
PEAK AI % 81% · §2
Analyzed
Oct 7
backend: pangram/v3.3
Segments scanned
3 windows
avg 61 words each
Distribution
5 / 95%
human / AI fraction
Verdict
AI
Pangram v3.3

Article text · 183 words · 3 segments analyzed

Human AI-generated
§1 Mixed · 39%

日本語 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.

§2 AI · 81%

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.

§3 Mixed · 38%

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?