Skip to content

Instantly share code, notes, and snippets.

@jerodsanto
Created October 25, 2012 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jerodsanto/3954379 to your computer and use it in GitHub Desktop.
Save jerodsanto/3954379 to your computer and use it in GitHub Desktop.
# e.g. - "AC 10 01 3D" => "172.16.1.61"
def hex2ip(hex)
hex.split(" ").map { |i| i.to_i(16) }.join(".")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment