tld
Fast compile-time static perfect hash set of all Top-Level Domains (TLDs), automatically kept in sync with the official IANA Root Zone Database.
Features
- ⚡ O(1) lookups with zero runtime allocation powered by
phf. - 📦
no_stdcompatible out of the box. - 🔄 Automated weekly updates from IANA.
- 🔤 Case-insensitive & exact lookup helpers.
Installation
Add to your Cargo.toml:
[]
= "2"
Usage
use ;
// Exact ASCII lowercase lookup
assert!;
assert!;
assert!;
assert!;
assert!;
// Case-insensitive lookup (no heap allocation)
assert!;
assert!;
assert!;
// Direct access to compile-time phf::Set
assert!;
println!;
License
Licensed under BSD 3-Clause.