def compat_sign(digest_method, key, message):
"""Sign message using old itsdangerous signer."""
return itsdangerous.Signer(
key, digest_method=get_digest(digest_method),
).get_signature(message)
python类Signer()的实例源码
def param_signer(self):
return Signer(self.config['SECRET_KEY'])
def get_signer():
return Signer(current_app.secret_key, salt='wrath-ctf')
def _get_signer(app):
if not app.secret_key:
return None
return Signer(app.secret_key, salt='flask-sessions',
key_derivation='hmac')
def _get_signer(self, app):
if not app.secret_key:
return None
return Signer(app.secret_key, salt='flask-session', key_derivation='hmac')