ipip 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 694497014aa8a4d19f7f93a0da6ef243c0547666
4
- data.tar.gz: c848fc0e06ec4ac8480730ec0dd5b8a1cd431573
3
+ metadata.gz: fceece4105bab077bd57c187a947c84553eb8e53
4
+ data.tar.gz: 9b601dc2136f172c3028f1a3fcd48ba87d2e8677
5
5
  SHA512:
6
- metadata.gz: 46918d36200178dbb38b5774efb358f1926bc9092b819b8286ddf8cc6514803d22136068159ff61975312986a79349683dfa3672f8a9179df71e7f990a5833d2
7
- data.tar.gz: 262e525bab7c3bf185aa4df861ba1d2ac5cb83b754fb94cfa267d336909a7f2ed512e0420e05b5d6e7e93b09e4db014306b6b4daf57afe128d40e16bde4e6f6e
6
+ metadata.gz: b6d69ef9ba54b88b838afbfba8def0d49aa1a5f77a675026abb37b19ad269c6200fe474bbbaf3bdb15c6f3f2355416183ea4078976c1f82e5db39be8e9e2d95e
7
+ data.tar.gz: 88a511c257f3da831957ca01e7c049fe1ed14f82bc1122ed632f411698c48e773f5c32c0c8166fc38489215a690cb43c1fca0656bed8608e6bb7b7f153358ff9
@@ -57,8 +57,8 @@ module IPIPX
57
57
 
58
58
  start = unpack_V(buffer[first_ip_offset, 4])
59
59
  start_offset = start * IP_BLOCK_SIZE + FIRST_IP_NUMBER_INDEX_SIZE
60
-
61
- lo, hi = 0, (offset - start_offset - OFFSET_NUMBER_SIZE) / IP_BLOCK_SIZE
60
+ end_offset = offset - FIRST_IP_NUMBER_INDEX_SIZE - OFFSET_NUMBER_SIZE
61
+ lo, hi = 0, (end_offset - start_offset) / IP_BLOCK_SIZE
62
62
 
63
63
  while lo < hi
64
64
  mid = (lo + hi) / 2
@@ -0,0 +1,12 @@
1
+ require './ipv4_database_x'
2
+
3
+
4
+ db = IPIPX::IPv4DatabaseX.new('/Users/liluo/github/ipip.datx')
5
+
6
+ puts db.find('223.155.165.74')
7
+ puts "-------------------"
8
+ puts db.find('210.155.165.74')
9
+ puts "-------------------"
10
+ puts db.find('114.155.165.77')
11
+ puts db.find('223.104.5.227')
12
+ puts db.find('223.211.233.221')
@@ -1,3 +1,3 @@
1
1
  module IPIP
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - liluo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-23 00:00:00.000000000 Z
11
+ date: 2017-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -50,6 +50,7 @@ files:
50
50
  - lib/ipip/17monipdb.dat
51
51
  - lib/ipip/ipv4_database.rb
52
52
  - lib/ipip/ipv4_database_x.rb
53
+ - lib/ipip/test.rb
53
54
  - lib/ipip/version.rb
54
55
  homepage: https://github.com/liluo/ipip
55
56
  licenses:
@@ -71,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
72
  version: '0'
72
73
  requirements: []
73
74
  rubyforge_project:
74
- rubygems_version: 2.4.8
75
+ rubygems_version: 2.6.10
75
76
  signing_key:
76
77
  specification_version: 4
77
78
  summary: IP search based on ipip.net