Skip to content

Instantly share code, notes, and snippets.

@ik5 ik5/int_to_ip.rb
Created Jun 5, 2019

Embed
What would you like to do?
short script to convert 32 bit integer to IPv4
#!/usr/bin/env ruby
require 'ipaddr'
ARGV.each do |int|
puts "#{int} = #{IPAddr.new(int.to_i, Socket::AF_INET).to_s}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.