title: How does iptolong work
body: <p>As we all know that long2ip works as ip1.ip2.ip3.ip4 (123.131.231.212) </p>
  
  <pre><code>long ip =&gt; (ip1 * 256 * 256 * 256) + (ip2 * 256 * 256) + (ip3 * 256) + ip4
  2072242132 =&gt; (123 * 256 * 256 * 256) + (131 * 256 * 256) + (231 * 256) + 212
  </code></pre>
  
  <p>But what would be pseudo code for converting this number back into an IP address?</p>
  
  <p>Also what would be the most suitable way to store IP addresses in MySQL for a traffic analytics website which will have about over 500 IP lookups per second?</p>
  
  <p>Would it be better if a table with unique IDs is created for every single IP and then that is used for lookups?</p>
  
  <p>Thanks</p>