Nameguard is a fast, language-agnostic validation engine for checking invalid, reserved, or disallowed names using curated datasets and structured rules
- Typical use cases include:
- subdomain and DNS label checks
- locale and timezone validation
- reserved keyword enforcement
-
Extremely fast lookups
- O(1) validation using compile-time generated data
- zero heap allocations during validation
-
Data-driven
- curated datasets for:
- locales
- timezones
- reserved subdomains / identifiers
- data is compiled into the binary (no runtime parsing)
- curated datasets for:
-
Pattern-aware validation
- structural rules (DNS labels, identifiers)
- prefix / suffix constraints
- regex only when unavoidable
-
Language-agnostic core
- Rust core with a stable C ABI
- bindings currently available for TypeScript
- designed for future ports (Go, Ruby, Python, etc.)
-
Safe by default
- explicit validation results
- no panics, no exceptions across FFI boundaries
-
Nameguard is optimized for hot paths:
- perfect hash sets (PHF)
- branch-predictable logic
- no heap allocations during validation
- no runtime data loading
-
This makes it suitable for:
- API gateways
- auth systems
- domain / username registration
- security-sensitive validation layers