def init_data_size(self, key): if self.data_size_list0: self.data_size_list0 = [] random = xorshift128plus() random.init_from_bin(key) # 补全数组长为12~24-1 list_len = random.next() % (8 + 16) + (4 + 8) for i in range(0, list_len): self.data_size_list0.append((int)(random.next() % 2340 % 2040 % 1440)) self.data_size_list0.sort()
def init_data_size(self, key): if self.data_size_list: self.data_size_list = [] self.data_size_list2 = [] random = xorshift128plus() random.init_from_bin(key) list_len = random.next() % 8 + 4 for i in range(0, list_len): self.data_size_list.append((int)(random.next() % 2340 % 2040 % 1440)) self.data_size_list.sort() list_len = random.next() % 16 + 8 for i in range(0, list_len): self.data_size_list2.append((int)(random.next() % 2340 % 2040 % 1440)) self.data_size_list2.sort()
def init_data_size(self, key): if self.data_size_list0: self.data_size_list0 = [] random = xorshift128plus() random.init_from_bin(key) list_len = random.next() % (8 + 16) + (4 + 8) for i in range(0, list_len): self.data_size_list0.append( (int)(random.next() % 2340 % 2040 % 1440)) self.data_size_list0.sort() old_len = len(self.data_size_list0) self.check_and_patch_data_size(random) if old_len != len(self.data_size_list0): self.data_size_list0.sort()
def init_data_size(self, key): if self.data_size_list0: self.data_size_list0 = [] random = xorshift128plus() random.init_from_bin(key) # 补全数组长为12~24-1 list_len = random.next() % (8 + 16) + (4 + 8) for i in range(0, list_len): self.data_size_list0.append((int)(random.next() % 2340 % 2040 % 1440)) self.data_size_list0.sort() old_len = len(self.data_size_list0) self.check_and_patch_data_size(random) # if check_and_patch_data_size are work, re-sort again. if old_len != len(self.data_size_list0): self.data_size_list0.sort()
def init_data_size(self, key): if self.data_size_list0: self.data_size_list0 = [] random = xorshift128plus() new_key = bytearray(key) for i in range(0, 8): new_key[i] ^= self.key_change_datetime_key_bytes[i] random.init_from_bin(new_key) list_len = random.next() % (8 + 16) + (4 + 8) for i in range(0, list_len): self.data_size_list0.append(int(random.next() % 2340 % 2040 % 1440)) self.data_size_list0.sort() old_len = len(self.data_size_list0) self.check_and_patch_data_size(random) if old_len != len(self.data_size_list0): self.data_size_list0.sort()
def init_data_size(self, key): if self.data_size_list0: self.data_size_list0 = [] random = xorshift128plus() # key xor with key_change_datetime_key new_key = bytearray(key) new_key_str = '' for i in range(0, 8): new_key[i] ^= self.key_change_datetime_key_bytes[i] new_key_str += chr(new_key[i]) for i in range(8, len(new_key)): new_key_str += chr(new_key[i]) random.init_from_bin(to_bytes(new_key_str)) # 补全数组长为12~24-1 list_len = random.next() % (8 + 16) + (4 + 8) for i in range(0, list_len): self.data_size_list0.append(int(random.next() % 2340 % 2040 % 1440)) self.data_size_list0.sort() old_len = len(self.data_size_list0) self.check_and_patch_data_size(random) # if check_and_patch_data_size are work, re-sort again. if old_len != len(self.data_size_list0): self.data_size_list0.sort()
def udp_rnd_data_len(self, last_hash, random): random.init_from_bin(last_hash) return random.next() % 127