wiki:ip2c

Version 4 (modified by omry, 12 years ago) (diff)

--

IP2C

IP2C is a project that provide IP to country resolution using a binary file.
The binary file is compiled from ip-to-country free database.

License

IP2C is licensed under GPL2, if you would like to use it in a non-gpl application please Contact me to obtain a non-gpl license.

Binary file compiler

The binary file compiler is a small java application that converts the CSV file to the binary format.
Usage: java net.firestats.ip2c.IP2CountryCompiler input.cvs output.bin.
the resulting binary file is very compact, a 3.5mb CSV file results in an 467k binary file.

IP2Country resolver

usage example java net.firestats.ip2c.IP2Country 85.64.225.159
PHP class coming soon.

Download

At the moment, only svn download is available:
to check out the latest code, run
svn co http://firefang.net/svn/firestats/trunk/ip2c/

Performence

Current java code takes less then 20ms to lookup an ip address in the full database on my computer.
this is working directly on the file, so memory usage is minimal (it does not load the whole file into memory).