前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Wing IDE Pro (Wing pro 6.0) for Ubuntu/linux

Wing IDE Pro (Wing pro 6.0) for Ubuntu/linux

作者头像
用户1148525
发布2019-05-28 23:33:56
1.1K0
发布2019-05-28 23:33:56
举报

Wing IDE Pro (Wing pro 6.0) for Ubuntu/linux

首先将下面的代码保存为aa.py 文件 代码源自:http://blog.csdn.net/u012885320/article/details/68980323

# aa.py

import string
import random
import sha

BASE16 = '0123456789ABCDEF'
BASE30 = '123456789ABCDEFGHJKLMNPQRTVWXY'


def randomstring(size=20, chars=string.ascii_uppercase + string.digits):
    return ''.join((random.choice(chars) for _ in range(size)))


def BaseConvert(number, fromdigits, todigits, ignore_negative=True):
    if not ignore_negative and str(number)[0] == '-':
        number = str(number)[1:]
        neg = 1
    else:
        neg = 0
    x = long(0)
    for digit in str(number):
        x = x * len(fromdigits) + fromdigits.index(digit)

    res = ''
    while x > 0:
        digit = x % len(todigits)
        res = todigits[digit] + res
        x /= len(todigits)

    if neg:
        res = '-' + res
    return res


def AddHyphens(code):
    return code[:5] + '-' + code[5:10] + '-' + code[10:15] + '-' + code[15:]


def SHAToBase30(digest):
    tdigest = ''.join([c for i, c in enumerate(digest) if i / 2 * 2 == i])
    result = BaseConvert(tdigest, BASE16, BASE30)
    while len(result) < 17:
        result = '1' + result
    return result


def loop(ecx, lichash):
    part = 0
    for c in lichash:
        part = ecx * part + ord(c) & 1048575
    return part

rng = AddHyphens('CN' + randomstring(18, '123456789ABCDEFGHJKLMNPQRTVWXY'))
print 'License id: ' + rng
act30 = raw_input('Enter request code:')
lichash = act30
hasher = sha.new()
hasher.update(act30)
hasher.update(rng)
lichash = AddHyphens(lichash[:3] + SHAToBase30(hasher.hexdigest().upper()))
part5 = format(loop(23, lichash), '05x') + format(loop(161, lichash), '05x') + format(loop(47, lichash),
                                                                                      '05x') + format(loop(9, lichash),
                                                                                                      '05x')
part5 = BaseConvert(part5.upper(), BASE16, BASE30)
while len(part5) < 17:
    part5 = '1' + part5

part5 = 'AXX' + part5
print 'Activation code: ' + AddHyphens(part5)

首先用 python 运行 aa.py, 得到一个License id, 例如 License id: CNXK5-THT5X-BL299-MA7GG,要求输入 Enter request code: 安装 Wing IDE Pro, 打开 Wing IDE Pro, 输入License id,得到 request code, 在 终端输入request code,得到 Activation code:

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017年07月25日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档