A 99.9% accurate offline IP address location database

A 99.9% accurate offline IP address location database

2022-09-05 0 470
Resource Number 38078 Last Updated 2025-02-24
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

This issue features an open-source offline IP address location library called Ip2region.

A 99.9% accurate offline IP address location database插图

Ip2region is an offline IP address location library with an accuracy rate of up to 99.9%, and a search performance of 0.0x milliseconds. The DB file is only a few megabytes in size, which stores all IP addresses. It supports queries for binding in Java, PHP, C, Python, Node.js, Go, C#, and Lua. The query algorithm uses binary trees, B-trees, and in-memory search algorithms.

functional characteristics

  • Query accuracy up to 99.9%

The data comes from some well-known IP query providers and has been tested to be more accurate than pure IP positioning.

  • >80%, Taobao IP address library: http://ip.taobao.com
  • ≈10%,GeoIP: https://geoip.com
  • ≈2%,Pure IP Library: http://www.cz88.net
  • Small file size

The database file ip2region.db is only a few MB in size, with the smallest version not exceeding 1.5MB and the largest not exceeding 8MB.

  • standard data format

Each IP data segment has a fixed format, and currently only domestic data can be accurately located at the city level. For other countries, only a portion can be located at the country level, and the default value for data that cannot be confirmed is 0.

_City ID | Country | Region | Province | City | ISP_
  • Fast query speed

All client queries are at the 0. x millisecond level and come with three built-in query algorithms:

  • Memory algorithm: The entire database is loaded into memory, and a single query occurs within 0.1x milliseconds. For C language clients, a single query occurs at the 0.00x millisecond level.
  • Binary algorithm: based on binary search, based on the ip2region.db file, does not require loading into memory, and a single query takes 0. x milliseconds.
  • B-tree algorithm: Based on the BTree algorithm and the ip2region.db file, it does not require loading into memory and word queries are faster than binary algorithms at the 0. x millisecond level.
  • Support for multiple query clients

The client has integrated Java, C #, PHP, C, Python, NodeJS, PHP extensions (PHP5 and PHP7), Golang, Rust, Lua, Lua_c, and nginx.

7986470e5baa4f5685fb90be1c2b9b44noop.image_

Quick installation

  • Maven warehouse address
<dependency>
    <groupId>org.lionsoul</groupId>
    <artifactId>ip2region</artifactId>
    <version>1.7.2</version>
</dependency>
  • nodejs
npm install node-ip2region --save
  • Nuget installation
Install-Package IP2Region
  • php composer
composer require zoujingli/ip2region

Quick testing

Please refer to the README instructions under each binding to run the CLI test program. For example, the demo in C language runs as follows:

cd binding/c/
gcc -g -O2 testSearcher.c ip2region.c
./a.out ../../data/ip2region.db

You will see the following CLI interface:

initializing  B-tree ... 
+----------------------------------+
| ip2region test scripA 99.9% accurate offline IP address location database插图2t            |
| Author: chenxin619315@gmail.com  |
| Type 'quit' to exit program      |
+----------------------------------+
p2region>> 101.105.35.57
2163 | China | South China | Guangdong Province | Shenzhen City | Dr. Peng in 0.02295 milliseconds

Enter the IP address to start testing. The first time may be a bit slow. After running the command, connect binary and memory to try other algorithms. It is recommended to use the b-tree algorithm. For speed and concurrency requirements, the memory algorithm can be used. Please refer to the testing source code under different bindings for specific integration.

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code A 99.9% accurate offline IP address location database https://ictcoder.com/kyym/a-99-9-accurate-offline-ip-address-location-database.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service