zmirror.py 文件源码

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

项目:zmirror 作者: aploium 项目源码 文件源码
def verify_ip_hash_cookie(hash_cookie_value):
    """
    ??cookie??hash??????????
    ? human_ip_verification ?????
    hash??14?
    hash(?7?+salt) = ?7? ???????
    :type hash_cookie_value: str
    :rtype: bool
    """
    try:
        input_key_hash = hash_cookie_value[:8]
        output_hash = hash_cookie_value[8:]
        calculated_hash = hex(zlib.adler32(
            (input_key_hash + human_ip_verification_answers_hash_str).encode(encoding='utf-8')
        ))[2:]
        if output_hash == calculated_hash:
            return True
        else:
            return False
    except:
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号