bottle.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:dabdabrevolution 作者: harryparkdotio 项目源码 文件源码
def cookie_encode(data, key, digestmod=None):
    """ Encode and sign a pickle-able object. Return a (byte) string """
    depr(0, 13, "cookie_encode() will be removed soon.",
                "Do not use this API directly.")
    digestmod = digestmod or hashlib.sha256
    msg = base64.b64encode(pickle.dumps(data, -1))
    sig = base64.b64encode(hmac.new(tob(key), msg, digestmod=digestmod).digest())
    return tob('!') + sig + tob('?') + msg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号