-
-
Save berga/6683bb2c3c36531a2762f963ad882eaa to your computer and use it in GitHub Desktop.
ruby integer to/from ip address
This file contains 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