def generate_token_string(self, action=None):
    digest_maker = self._digest_maker()
    digest_maker.update(self.user_id)
    digest_maker.update(self._DELIMITER)
    if action:
      digest_maker.update(action)
      digest_maker.update(self._DELIMITER)

    digest_maker.update(str(self.current_time))
    return base64.urlsafe_b64encode(
      self._DELIMITER.join(
        [digest_maker.hexdigest(),
        str(self.current_time)]
      ))
Generate a hash of the given token contents that can be verified.
dataset/ETHPy150Open gregorynicholas/flask-xsrf/flask_xsrf.py/XSRFToken.generate_token_string