diff --git a/binding/lua/ReadMe.md b/binding/lua/README.md similarity index 97% rename from binding/lua/ReadMe.md rename to binding/lua/README.md index 9b0669e..460c2ca 100644 --- a/binding/lua/ReadMe.md +++ b/binding/lua/README.md @@ -177,7 +177,7 @@ ip2region xdb searcher test program source xdb: ../../data/ip2region_v4.xdb (IPv4, vectorIndex) type 'quit' to exit ip2region>> 1.2.3.4 -{region: 美国|华盛顿|0|谷歌, io_count: 7, took: 0μs} +{region: Australia|Queensland|Brisbane|0|AU, io_count: 5, took: 0μs} ``` 例如:使用默认的 data/ip2region_v6.xdb 文件进行 IPv6 的查询测试: @@ -187,7 +187,9 @@ ip2region xdb searcher test program source xdb: ../../data/ip2region_v6.xdb (IPv6, vectorIndex) type 'quit' to exit ip2region>> 240e:3b7:3272:d8d0:db09:c067:8d59:539e -{region: 中国|广东省|深圳市|家庭宽带, io_count: 8, took: 0μs} +{region: 中国|广东省|深圳市|电信|CN, io_count: 8, took: 0μs} +ip2region>> 2604:a840:3::a04d +{region: United States|California|San Jose|xTom|US, io_count: 13, took: 0μs} ``` 输入 ip 即可进行查询测试。也可以分别设置 `cache-policy` 为 file/vectorIndex/content 来测试三种不同缓存实现的效率。 diff --git a/binding/lua_c/ReadMe.md b/binding/lua_c/README.md similarity index 94% rename from binding/lua_c/ReadMe.md rename to binding/lua_c/README.md index 628ecfd..76dccc2 100644 --- a/binding/lua_c/ReadMe.md +++ b/binding/lua_c/README.md @@ -91,7 +91,7 @@ end -- 2、调用查询 API 进行查询,IPv4 和 IPv6 都支持 local ip_str = "1.2.3.4" --- ip_str = "2001:4:112:ffff:ffff:ffff:ffff:ffff" // IPv6 +-- ip_str = "240e:3b7:3272:d8d0:db09:c067:8d59:539e" // IPv6 local s_time = xdb.now() region, err = searcher:search(ip_str) local c_time = xdb.now() - s_time @@ -135,7 +135,7 @@ end -- 3、调用查询 API ,IPv4 和 IPv6 都支持 local ip_str = "1.2.3.4" --- ip_str = "2001:4:112:ffff:ffff:ffff:ffff:ffff" // IPv6 +-- ip_str = "240e:3b7:3272:d8d0:db09:c067:8d59:539e" // IPv6 local s_time = xdb.now() region, err = searcher:search(ip_str) local c_time = xdb.now() = s_time @@ -179,7 +179,7 @@ end -- 3、调用查询 API ,IPv4 和 IPv6 都支持 local ip_str = "1.2.3.4" --- ip_str = "2001:4:112:ffff:ffff:ffff:ffff:ffff" // IPv6 +-- ip_str = "240e:3b7:3272:d8d0:db09:c067:8d59:539e" // IPv6 local s_time = xdb.now() region, err = searcher:search(ip_str) local c_time = xdb.now() - s_time @@ -219,8 +219,10 @@ options: ip2region xdb searcher test program source xdb: ../../data/ip2region_v4.xdb (IPv4, vectorIndex) type 'quit' to exit +ip2region>> 1.2.3.4 +{region: Australia|Queensland|Brisbane|0|AU, io_count: 5, took: 17μs} ip2region>> 120.229.45.2 -{region: 中国|广东省|深圳市|移动, io_count: 3, took: 34μs} +{region: 中国|广东省|深圳市|移动|CN, io_count: 3, took: 40μs} ``` 例如:使用默认的 data/ip2region_v6.xdb 进行 IPv6 查询测试: @@ -231,8 +233,10 @@ source xdb: ../../data/ip2region_v6.xdb (IPv6, vectorIndex) type 'quit' to exit ip2region>> :: {region: , io_count: 1, took: 48μs} -ip2region>> 240e:3b7:3276:33b0:958f:f34c:d04f:f6a -{region: 中国|广东省|深圳市|家庭宽带, io_count: 8, took: 51μs} +ip2region>> 240e:3b7:3276:33b0:958f:f34c:d04f:f6a +{region: 中国|广东省|深圳市|电信|CN, io_count: 8, took: 52μs} +ip2region>> 2604:a840:3::a04d +{region: United States|California|San Jose|xTom|US, io_count: 13, took: 35μs} ``` 输入 ip 即可进行查询测试。也可以分别设置 `cache-policy` 为 file/vectorIndex/content 来测试三种不同缓存实现的效率。 diff --git a/binding/php/ReadMe.md b/binding/php/README.md similarity index 93% rename from binding/php/ReadMe.md rename to binding/php/README.md index 20f3523..d724e98 100644 --- a/binding/php/ReadMe.md +++ b/binding/php/README.md @@ -68,7 +68,7 @@ try { // 2, 查询,IPv4 或者 IPv6 的地址都支持 try { $ip = '1.2.3.4'; - // $ip = "2001:4:112:ffff:ffff:ffff:ffff:ffff"; // IPv6 + // $ip = ""240e:3b7:3272:d8d0:db09:c067:8d59:539e; // IPv6 $sTime = Util::now(); $region = $searcher->search($ip); $costMs = Util::now() - $sTime; @@ -111,7 +111,7 @@ try { // 3、查询,IPv4 或者 IPv6 都支持 try { $ip = '1.2.3.4'; - // $ip = "2001:4:112:ffff:ffff:ffff:ffff:ffff"; // IPv6 + // $ip = "240e:3b7:3272:d8d0:db09:c067:8d59:539e"; // IPv6 $sTime = Util::now(); $region = $searcher->search($ip); $costMs = Util::now() - $sTime; @@ -153,7 +153,7 @@ try { // 3、查询,IPv4 或者 IPv6 都支持 try { $ip = '1.2.3.4'; - // $ip = "2001:4:112:ffff:ffff:ffff:ffff:ffff"; // IPv6 + // $ip = "240e:3b7:3272:d8d0:db09:c067:8d59:539e"; // IPv6 $sTime = Util::now(); $region = $searcher->search($ip); $costMs = Util::now() - $sTime; @@ -186,8 +186,10 @@ options: ip2region xdb searcher test program source xdb file: ../../data/ip2region_v4.xdb (IPv4, vectorIndex) type 'quit' to exit +ip2region>> 1.2.3.4 +{region: Australia|Queensland|Brisbane|0|AU, ioCount: 5, took: 0.12695 ms} ip2region>> 120.229.45.2 -{region: 中国|广东省|深圳市|移动, ioCount: 3, took: 0.02783 ms} +{region: 中国|广东省|深圳市|移动|CN, ioCount: 3, took: 0.07397 ms} ``` 例如:使用默认的 data/ip2region_v6.xdb 进行 IPv6 的查询测试: @@ -199,7 +201,9 @@ type 'quit' to exit ip2region>> :: {region: , ioCount: 1, took: 0.08887 ms} ip2region>> 240e:3b7:3272:d8d0:db09:c067:8d59:539e -{region: 中国|广东省|深圳市|家庭宽带, ioCount: 8, took: 0.09595 ms} +{region: 中国|广东省|深圳市|电信|CN, ioCount: 8, took: 0.10303 ms} +ip2region>> 2604:a840:3::a04d +{region: United States|California|San Jose|xTom|US, ioCount: 13, took: 0.04614 ms} ``` 输入 ip 即可进行查询测试。也可以分别设置 `cache-policy` 为 file/vectorIndex/content 来测试三种不同缓存实现的效率。 @@ -231,4 +235,4 @@ php bench_test.php --db=../../data/ip2region_v6.xdb --src=../../data/ipv6_source ### 第三方仓库支持 -1. composer 支持的 [zoujingli/ip2region](https://github.com/zoujingli/ip2region) - 已提供 IPv6 支持。 \ No newline at end of file +1. composer 支持的 [zoujingli/ip2region](https://github.com/zoujingli/ip2region) - 已提供 IPv6 支持。 diff --git a/binding/python/ReadMe.md b/binding/python/README.md similarity index 95% rename from binding/python/ReadMe.md rename to binding/python/README.md index d057b82..8eb9a0e 100644 --- a/binding/python/ReadMe.md +++ b/binding/python/README.md @@ -177,7 +177,9 @@ ip2region xdb searcher test program source xdb: ../../data/ip2region_v4.xdb (IPv4, vectorIndex) type 'quit' to exit ip2region>> 1.2.3.4 -{region: 美国|华盛顿|0|谷歌, ioCount: 7, took: 185 μs} +{region: Australia|Queensland|Brisbane|0|AU, ioCount: 5, took: 188 μs} +ip2region>> 113.118.113.77 +{region: 中国|广东省|深圳市|电信|CN, ioCount: 2, took: 143 μs} ``` 例如:使用默认的 data/ip2region_v6.xdb 文件进行 IPv6 的查询测试: @@ -186,8 +188,12 @@ ip2region>> 1.2.3.4 ip2region xdb searcher test program source xdb: ../../data/ip2region_v6.xdb (IPv6, vectorIndex) type 'quit' to exit +ip2region>> :: +{region: , ioCount: 1, took: 166 μs} ip2region>> 240e:3b7:3272:d8d0:db09:c067:8d59:539e -{region: 中国|广东省|深圳市|家庭宽带, ioCount: 8, took: 211 μs} +{region: 中国|广东省|深圳市|电信|CN, ioCount: 8, took: 197 μs} +ip2region>> 2604:a840:3::a04d +{region: United States|California|San Jose|xTom|US, ioCount: 13, took: 240 μs} ``` 输入 ip 即可进行查询测试,也可以分别设置 `cache-policy` 为 file/vectorIndex/content 来测试三种不同缓存实现的查询效果。