code: def dump(self, src, length=16, start=0, preffix=""):
          
          FILTER = \
              "".join([(len(repr(chr(x)))==3) and chr(x) or '.' \
                  for x in xrange(256)])
  
          result = list()
  
          for i in xrange(0, len(src), length):
              s           = src[i : i + length]
              hexa        = " ".join(["%02X" % ord(x) for x in s])
              printable   = s.translate(FILTER)
  
              result.append("%s%08X   %-*s   %s\n" % \
                  (preffix, start + i, length * 3, hexa, printable))
  
          return ''.join(result)
docs: Dump the specified buffer in hex + ASCII format.