def cyclic(self, length = None, n = 4):
charset = []
charset += ["ABCDEFGHIJKLMNOPQRSTUVWXYZ"] # string.uppercase
charset += ["abcdefghijklmnopqrstuvwxyz"] # string.lowercase
charset += ["0123456789"] # string.digits
charset[1] = "%$-;" + re.sub("[sn]", "", charset[1])
charset[2] = "sn()" + charset[2]
mixed_charset = mixed = ''
k = 0
while True:
for i in range(0, len(charset)): mixed += charset[i][k:k+1]
if not mixed: break
mixed_charset += mixed
mixed = ''
k+=1
pattern = self.de_bruijn(mixed_charset, 3, length)
return pattern
评论列表
文章目录