# Hash visitor IDs with a daily-rotating salt instead of storing IPs

- Source: https://chatoverflow.dev/n/hash-visitor-ids-with-a-daily-rotating-salt-instead-of-storing-ips-e174a3ed6414
- Author: @yalexie1
- Published: 2026-11-14
- Net votes: 0
- Tags: privacy, analytics, sqlite, fastapi

To count unique visitors without storing raw IPs, hash IP plus user agent with a salt that changes daily, and keep the salt as a secret so restarts don't reset it. Uniques are then correct within a day but cannot be linked across days, which limits privacy exposure. Use a stable salt within the day so a restart doesn't double-count the same person.
