= IP2C = IP2C is a small library that provides IP to country resolution using a binary file.[[BR]] The binary file is compiled from [http://ip-to-country.webhosting.info/ ip-to-country] free database and takes only 460kb (the CSV takes about 3.5mb).[[BR]] Supported languages:[[BR]] * Java * PHP (Soon) == Performance == Current Java code takes less then 20ms to lookup an ip address on my computer.[[BR]] this is working directly on the file, so memory usage is minimal (it does not load the whole file into memory). == License == IP2C is licensed under GPL2, if you would like to use it in a non-gpl application please [wiki:Contact] me to obtain a non-gpl license. == JAVA == Usage : To resolve an IP address: java -jar ip2c.jar ip-address Output format: if not found: UNKNOWN if found: 2C 3C NAME Example: java -jar ip2c.jar 85.64.225.159 Outputs: IL ISR ISRAEL To build binary file from CSV: java -jar ip2c csv_file bin_file == PHP == Install the ip2country.php and the binary file in the same directroy. {{{ #!php get_country("85.64.225.159"); if ($res == false) echo "not found"; else { $o2c = $res['id2']; $o3c = $res['id3']; $oname = $res['name']; echo "$o2c $o3c $oname"; // will output IL ISR ISRAEL } ?> }}} == Download == [http://firefang.net/projects/firestats/browser/trunk/ip2c/release/ip2c-1.1.zip?format=raw ip2c 1.1] == Source == [source:/trunk/ip2c Browse source]