Module: NETSNMP::Hexdump
- Defined in:
- lib/netsnmp/extensions.rb
Class Method Summary collapse
Class Method Details
.dump(data, width: 8, in_groups_of: 4, separator: "\n") ⇒ Object
110 111 112 113 114 115 |
# File 'lib/netsnmp/extensions.rb', line 110 def self.dump(data, width: 8, in_groups_of: 4, separator: "\n") pairs = data.unpack1("H*").scan(/.{#{in_groups_of}}/) pairs.each_slice(width).map do |row| row.join(" ") end.join(separator) end |