Scapy在代码中看到了易失性.py.
在while
条件下,(1 << n)
的含义是什么?在
def __init__(self, inf, sup, seed=None, forever=1, renewkeys=0):
self.forever = forever
self.renewkeys = renewkeys
self.inf = inf
self.rnd = random.Random(seed)
self.sbox_size = 256
self.top = sup-inf+1
n=0
while (1<<n) < self.top:
n += 1
self.n =n
self.fs = min(3,(n+1)/2)
self.fsmask = 2**self.fs-1
self.rounds = max(self.n,3)
self.turns = 0
self.i = 0
<;<;是位运算符,如here所述:
因此,在您提供的代码中,while循环一直到2的最大幂,它小于
self.top
,如果我们假设self.top公司是100,小于100的2的最大幂是64,如果是200,它会一直到128相关问题 更多 >
编程相关推荐