1
from warnings import warn
2
from beaker import util
6
# Use PyCrypto (if available)
7
from Crypto.Hash import HMAC as hmac, SHA as hmac_sha1
12
# PyCrypto not available. Use the Python standard library.
15
# When using the stdlib, we have to make sure the hmac version and sha
16
# version are compatible
18
from sha import sha as sha1
19
import sha as hmac_sha1
21
# NOTE: We have to use the callable with hashlib (hashlib.sha1),
22
# otherwise hmac only accepts the sha module object itself
23
from hashlib import sha1
30
from hashlib import md5