thorn.utils.hmac

HMAC Message signing utilities.

thorn.utils.hmac.compat_sign(digest_method, key, message)[source]

Sign message using old itsdangerous signer.

thorn.utils.hmac.get_digest(d)[source]

Get digest type by name (e.g. "sha512").

thorn.utils.hmac.random_secret(length, chars=u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#$%&()*+, -./:;<=>?@[\\]^_`{|}~')[source]

Generate random secret (letters, digits, punctuation).

thorn.utils.hmac.sign(digest_method, key, message)[source]

Sign HMAC digest.

thorn.utils.hmac.verify(digest, digest_method, key, message)[source]

Verify HMAC digest.