-
-
Save bogdanRada/34bd83983c4bd51230d2f1c63bda419f to your computer and use it in GitHub Desktop.
ruby integer to/from ip address
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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