python hmac解密

时间:2019-02-27 22:15:54   收藏:0   阅读:406
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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!