Releases: marselester/maxminddb.zig
Releases · marselester/maxminddb.zig
v0.4.0
Fix within() bugs that caused nodes skipping:
- When startNode() returns a data pointer, the code skipped it because of "if (node < node_count)".
- When traversing the prefix, if a data record is encountered before exhausting all prefix bits (querying /24 but record is at /23), the code skipped the data pointer.
Add IP address validation to within() and lookup: when IPv6 address was used on IPv4-only database, the results could be garbage, so such address is rejected now.
Full Changelog: v0.3.0...v0.4.0
v0.3.0
v0.2.0
Changelog
Network.parsewas added to parse CIDRFieldsfiltering was added to speed up decoding. Note,lookupandwithinnow expectOptionsstruct.
const fields = maxminddb.Fields.from(maxminddb.geolite2.City, &.{ "city", "country" });
const city = try db.lookup(allocator, maxminddb.geolite2.City, &ip, .{ .only = fields });Basic features
This release provides:
- basic features found in Go/Rust libraries such as lookup by IP and network traversal
- safety checks seen in Go/Rust libraries
- compliance with the MaxMind DB spec, e.g., the requirement for struct fields to match database field order requirement was removed from the library