python hmac解密

import hmac

def get_singa_true(timestamp):
    sha1 = hmac.new("d1b964811afb40118a12068ff74a12f4".encode('utf8'), digestmod='sha1')
    sha1.update("password".encode('utf8'))
    sha1.update("c3cef7c66a1843f8b3a9e6a1e3160e20".encode('utf8'))
    sha1.update("com.zhihu.web".encode('utf8'))
    sha1.update(str(timestamp).encode('utf8'))
    return sha1.hexdigest()

转载于:https://www.cnblogs.com/c-x-a/p/10447267.html

你可能感兴趣的:(python)