code: def hex_encode(input, errors='strict'):
      
      assert errors == 'strict'
      temp = binascii.b2a_hex(input)
      output = " ".join(temp[i:i + 2] for i in xrange(0, len(temp), 2))
      return (output, len(input))
docs: Encodes the object input and returns a tuple (output
          object, length consumed).
  
          errors defines the error handling to apply. It defaults to
          'strict' handling which is the only currently supported
          error handling for this codec.