Git Product home page Git Product logo

lxngoddess5321 / ipfirst Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haohailuo/ipfirst

0.0 0.0 0.0 5.49 MB

可以压缩任何IP数据,并提供python,php,java,go等7个版本的IP查询代码。效率可达到每秒百万级别查询。IP原始数据压缩,高并发,高性能,可以自由定制以达到极限的性能。

Python 22.54% C# 17.89% C++ 13.20% C 0.43% Go 18.27% Java 11.51% PHP 9.85% Ruby 6.31%

ipfirst's Introduction

ipfirst

此代码主要是利用pandas将原始的ip库数据压缩成二进制,并通过建立索引进行高效的查找,压缩率大致是在十倍左右,主要由不同的需求决定最终的压缩比率。

代码

  • ip-parse-*:都是解析代码来自曾祥展,未做改动。目前有c#,c++,go,java,php,python,ruby版本。欢迎贡献更多版本。
  • PackIp.py:是主要的处理代码,未封装。
  • IpFunction.py:是各种用来处理数据的小函数。
  • ip-utf8.dat:即最后生成的二进制文件。
  • chunzhen.txt:一份供大家测试的ip库原始数据。

反馈

如果有更好的数据结构或者算法欢迎来信[email protected]

说明

  1. 由于本人水平太差,并没有对代码进行封装。欢迎大神来改写。
  2. 编写基于py2.7,py3.5应该也能运行
  3. 由于编写基于ipip的数据库需要购买,为了不影响ipip的利益暂不提供。仅提供一份纯真ip库供大家测试,但是纯真的ip库格式需要先自行处理下以便pandas可以正常处理。

压缩率和查询性能目前比曾祥展和IPIP的都要好。

ipfirst's People

Contributors

cutd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.