Created
January 6, 2012 04:20
-
-
Save anonymous/1568959 to your computer and use it in GitHub Desktop.
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' | |
ip = IPAddr.new "140.211.166.66" | |
p 66.to_s(16) #=> "42" | |
p ip.hton #=> "\x8C\xD3\xA6B" | |
# Expected "\x8C\xD3\xA6\x42" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment