QQ会员g_tk python版

def g_tk(skey):
    hash = 5381
    md5key = 'tencentQQVIP123443safde&!%^%1282'
    result = []
    result.append(hash << 5)
    for i in range(len(skey)):
        ascode = ord(skey[i:i+1])
        result.append((hash << 5)+ascode)
        hash = ascode
    strs = "".join([str(i) for i in result]) + md5key
    m = hashlib.md5()
    print(strs)
    m.update(bytes(strs,encoding='utf-8'))
    return m.hexdigest()

你可能感兴趣的:(QQ会员g_tk python版)