Guest User

Untitled

a guest
Jul 16th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. def mask_to_cidr(netmask)
  2. octets = netmask.split(".").map{|i| i.to_i}
  3. octets.pack("C"*octets.size).unpack("B*").first.count "1"
  4. end
Add Comment
Please, Sign In to add comment