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()
posted @ 2019-02-27 21:48  公众号python学习开发  阅读(1134)  评论(0编辑  收藏  举报