czdb 0.1.4

A pure Rust library for parsing CZDB-format IP databases.
Documentation
# czdb-rs

[![Crates.io](https://img.shields.io/crates/v/czdb)](https://crates.io/crates/czdb)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://docs.rs/czdb)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/AldenClark/czdb-rs/blob/main/LICENSE)

czdb-rs is a lightweight Rust library for querying CZDB-format IP geolocation databases. It supports both IPv4 and IPv6 lookups and provides multiple loading strategies for different performance needs.

- Buffered reader by default for low memory usage
- Optional memory-mapped file loading via the `mmap` feature
- Fully in-memory loading for fastest access

> The database file and key must be obtained from [www.cz88.net]https://cz88.net/geo-public.

## Usage
```bash
cargo add czdb
```

```rust
use czdb::Czdb;
use std::net::IpAddr;

let db = Czdb::new("path/to/your/czdb_file", "your_base64_key")?;
let ip: IpAddr = "8.8.8.8".parse().unwrap();
if let Some(location) = db.search(ip) {
    println!("Location for {}: {}", ip, location);
}
# Ok::<(), Box<dyn std::error::Error>>(())
```

For the Chinese version of this document, see [README.zh.md](README.zh.md).