title: how to extract the 4 bytes of a 32bit int in lua
body: <p>I have a lua function that converts ip addresses to 32 bit int</p>
  
  <pre><code>local str = "127.0.0.1"
  local o1,o2,o3,o4 = str:match("(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)" )
  local num = 2^24*o1 + 2^16*o2 + 2^8*o3 + o4
  </code></pre>
  
  <p>I would like to have the inverse function, i.e. get the 4 bytes from the int</p>