[Python] 纯文本查看 复制代码 #!/usr/bin/env python
# encoding: utf-8
def fuck0x(a):
tmp1=[]
tmp2=''
for i in a:
tmp2=''
for ii in range(len(i)):
if ii in (0, 1):
continue
tmp2+=i[ii]
tmp1.append(tmp2)
return tmp1
def toupper(a):
for i in range(len(a)):
a[i]=a[i].upper()
return a
username=input('请输入账号:')
userkey=input('请输入注册码:')
try:
number=int(username)
except Exception:
None
None
None
print('账号必须是整数')
keys=[]
keys.append(str(hex(number * 234863)))
keys.append(str(hex(number)))
keys.append(str(hex(int(number / 6668648))))
keys.append(str(hex(number * 18584564)))
keys.append(str(hex(number * 5556546)))
keys=fuck0x(keys)
keys=toupper(keys)
for i in range(5):
if len(keys[i])<=5:
continue
keys[i]=keys[i][0:5]
key='{0}-{1}-{2}-{3}-{4}'.format(keys[0], keys[1], keys[2], keys[3], keys[4])
if key==userkey:
print('注册成功')
else:
print('注册失败')
input()
def fuck0x(a):
tmp1=[]
tmp2=''
for i in a:
tmp2=''
for ii in range(len(i)):
if ii in (0, 1):
continue
tmp2+=i[ii]
tmp1.append(tmp2)
return tmp1
def toupper(a):
for i in range(len(a)):
a[i]=a[i].upper()
return a
username=input('请输入账号:')
userkey=input('请输入注册码:')
try:
number=int(username)
except Exception:
None
None
None
print('账号必须是整数')
keys=[]
keys.append(str(hex(number * 234863)))
keys.append(str(hex(number)))
keys.append(str(hex(int(number / 6668648))))
keys.append(str(hex(number * 18584564)))
keys.append(str(hex(number * 5556546)))
keys=fuck0x(keys)
keys=toupper(keys)
for i in range(5):
if len(keys[i])<=5:
continue
keys[i]=keys[i][0:5]
key='{0}-{1}-{2}-{3}-{4}'.format(keys[0], keys[1], keys[2], keys[3], keys[4])
if key==userkey:
print('注册成功')
else:
print('注册失败')
input() |