Version 9 (modified by omry, 14 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 and takes only 460kb (the CSV takes about 3.5mb).
Supported languages:
- Java
- PHP (Soon)
Performance
Current Java code takes less then 20ms to lookup an ip address on my computer.
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 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