wiki:ip2c

Version 7 (modified by omry, 11 years ago) (diff)

--

IP2C

IP2C is a small library that provides IP to country resolution using a binary file.
The binary file is compiled from ip-to-country free database.
Supported languages:

  • Java
  • PHP (Soon)

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.

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 file:
java -jar ip2c csv_file bin_file

Download

ip2c 1.0

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).