iptocc
Fast, offline IPv4/IPv6 to ISO 3166-1 alpha-2 country code lookup for Rust.
Features
- Offline lookup, no API keys, no network calls
- IPv4 and IPv6 in one call
- Single-address
country_codeand batchcountry_codesfunctions - Lookup data embedded via
include_bytes!; no runtime file I/O iptoccCLI binary installed alongside the library- Database refreshed nightly from the five Regional Internet Registries
Install
Usage
use ;
let cc = country_code;
assert_eq!;
let codes = country_codes;
assert_eq!;
A CLI is installed by cargo install iptocc: