def __get_f(self, s):
i = 0
t = ''
l = string.ascii_uppercase + string.ascii_lowercase + string.digits + '+/'
while i < len(s):
try:
c1 = l.index(s[i])
c2 = l.index(s[i + 1])
t += chr(c1 << 2 & 255 | c2 >> 4)
c3 = l.index(s[i + 2])
t += chr(c2 << 4 & 255 | c3 >> 2)
c4 = l.index(s[i + 3])
t += chr(c3 << 6 & 255 | c4)
i += 4
except:
break
return t
评论列表
文章目录