Skip to content

Instantly share code, notes, and snippets.

@bogdanRada
Forked from qsun/gist:1247402
Created June 14, 2016 12:31
Show Gist options
  • Save bogdanRada/34bd83983c4bd51230d2f1c63bda419f to your computer and use it in GitHub Desktop.
Save bogdanRada/34bd83983c4bd51230d2f1c63bda419f to your computer and use it in GitHub Desktop.
ruby integer to/from ip address
require 'ipaddr'
IPAddr.new('1.2.3.4').to_i
IPAddr.new(16909060, Socket::AF_INET).to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment