# File lib/packetfu/packet.rb, line 304 def hexify(str) hexascii_lines = str.to_s.unpack("H*")[0].scan(/.{1,32}/) chars = str.to_s.gsub(/[\x00-\x1f\x7f-\xff]/,'.') chars_lines = chars.scan(/.{1,16}/) ret = [] hexascii_lines.size.times {|i| ret << "%-48s %s" % [hexascii_lines[i].gsub(/(.{2})/,"\\1 "),chars_lines[i]]} ret.join("\n") end