def addMask(self, col, mask): colLen = len(cfg.cleanHexStr(self.vals[col])) * 4 if(len(mask) > colLen): return "Error:Mask is too long" else: # Pad our mask with either 0s or 1s to fill entire column if(mask.endswith('0')): mask = mask.ljust(colLen, '0') else: mask = mask.ljust(colLen, '1') mask = self.delimCol(cfg.binStrToHexStr(mask), col) if(not col in self.gen): self.gen[col] = {'count': 0, 'step': 0, 'mask': mask} else: self.gen[col]['mask'] = mask
def addGenerator(self, col, count, step): if(not col in self.gen): self.gen[col] = {'count': count, 'step': step, 'mask': self.delimCol(''.join('0' * (len(cfg.cleanHexStr(self.vals[col])))), col)} else: self.gen[col]['count'] = count self.gen[col]['step'] = step