zmirror.py 文件源码

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

项目:zmirror 作者: aploium 项目源码 文件源码
def generate_ip_verify_hash(input_dict):
    """
    ???????????hash
    ? human_ip_verification ?????
    hash??14?
    hash(?7?+salt) = ?7? ???????
    :rtype str
    """
    strbuff = human_ip_verification_answers_hash_str
    for key in input_dict:
        strbuff += key + input_dict[key] + str(random.randint(0, 9000000))
    input_key_hash = hex(zlib.adler32(strbuff.encode(encoding='utf-8')))[2:]
    while len(input_key_hash) < 7:
        input_key_hash += '0'
    output_hash = hex(zlib.adler32((input_key_hash + human_ip_verification_answers_hash_str).encode(encoding='utf-8')))[2:]
    while len(output_hash) < 7:
        output_hash += '0'
    return input_key_hash + output_hash
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号