def unhash_question(question):
 if (len(question) < 40):
  raise ValueError(u'Invalid data')
 hexsha = question[:40]
 timestamp = question[40:50]
 try:
  question = b64decode(question[50:]).decode(u'utf-8')
 except (TypeError, UnicodeError):
  raise ValueError(u'Invalid encoding')
 if (hexsha != checksum_question(question, timestamp)):
  raise ValueError(u'Tampered question!')
 return (question, int(timestamp, 16))

def unhash_question ( question ) : if ( len ( question ) < 40 ) : raise ValueError ( u'Invalid data' ) hexsha = question [ : 40 ] timestamp = question [ 40 : 50 ] try : question = b64decode ( question [ 50 : ] ) . decode ( u'utf-8' ) except ( TypeError , UnicodeError ) : raise ValueError ( u'Invalid encoding' ) if ( hexsha != checksum_question ( question , timestamp ) ) : raise ValueError ( u'Tampered question!' ) return ( question , int ( timestamp , 16 ) )
unhashes question .