View Single Post
  #7 (permalink)  
Old 09-30-2008, 06:02 PM
Tech Manager Tech Manager is offline
WebProWorld Pro
 
Join Date: Jan 2008
Posts: 290
Tech Manager RepRank 1
Default Re: I am looking for a PHP algorithm/script

Quote:
Originally Posted by kgun View Post
  1. Is there a unique formulae?
  2. I am not an expert. A question I have asked myself is if there is an overlap for different countries?
You don't imply by that that it is simple addition (modulo a number)?


So to repeat in other words, you are in a sense looking for least common denominators (like of prime numbers)?


And googling by different KW's does not give relevant hits.

The reason I mentioned the two above sites is that they are experts on IP-related problems, so they may know of such a script. DnsStuff has a forum. Gary Keith may be contacted by a simple question.
1.) There is a unique formula. Think of it this way. The database(s) contain the complete listing of every IP address/network in the world. Each assigned network is keyed to a specific country, registrar and also has a unique key identifying the network.

When a request is made for a country or countries, the data is sorted by country first and then IP address. The formula for contiguous network is fairl simple. If country and ending IP range +1 is equal to country and starting IP range, you have a contiguous network.
__________________
I use Country IP Blocks as added security for my networks and servers.
Reply With Quote