module By2::Utils
Public Class Methods
fdate(date)
click to toggle source
# File lib/by2/utils.rb, line 18 def self.fdate(date) date.strftime("%Y-%m-%d") end
hex_to_ascii(hex)
click to toggle source
# File lib/by2/utils.rb, line 14 def self.hex_to_ascii(hex) [hex].pack("H*") end
int32_to_ip(int32)
click to toggle source
# File lib/by2/utils.rb, line 6 def self.int32_to_ip(int32) IPAddr.new(int32, Socket::AF_INET).to_s end
ip_to_int32(ip)
click to toggle source
# File lib/by2/utils.rb, line 10 def self.ip_to_int32(ip) IPAddr.new(ip).to_i end