def Hexdump(data, width=16):
 for offset in xrange(0, len(data), width):
  row_data = data[offset:(offset + width)]
  translated_data = [(x if ((ord(x) < 127) and (ord(x) > 32)) else '.') for x in row_data]
  hexdata = ' '.join(['{0:02x}'.format(ord(x)) for x in row_data])
  (yield (offset, hexdata, translated_data))

def Hexdump ( data , width = 16 ) : for offset in xrange ( 0 , len ( data ) , width ) : row_data = data [ offset : ( offset + width ) ] translated_data = [ ( x if ( ( ord ( x ) < 127 ) and ( ord ( x ) > 32 ) ) else '.' ) for x in row_data ] hexdata = ' ' . join ( [ '{0:02x}' . format ( ord ( x ) ) for x in row_data ] ) ( yield ( offset , hexdata , translated_data ) )
hexdump function shared by various plugins .