Example #1
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Group, self).hash()
     return khash(hashed, frozenset(self._values))
Example #2
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Repeat, self).hash()
     return khash(hashed, self._min_times, self._max_times, self._step, self._repeats)
Example #3
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(String, self).hash()
     return khash(hashed, self._max_size)
Example #4
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Conditional, self).hash()
     return khash(hashed, self._condition.hash())
Example #5
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(RandomBits, self).hash()
     return khash(hashed, self._min_length, self._max_length, self._num_mutations, self._step, self._seed)
Example #6
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Group, self).hash()
     return khash(hashed, frozenset(self._values))
Example #7
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Pad, self).hash()
     return khash(hashed, self._pad_length, self._pad_data)
Example #8
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Trunc, self).hash()
     return khash(hashed, self._max_size)
Example #9
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(ForEach, self).hash()
     return khash(hashed + self._mutated_field.hash())
Example #10
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Conditional, self).hash()
     return khash(hashed, self._condition.hash())
Example #11
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Trunc, self).hash()
     return khash(hashed, self._max_size)
Example #12
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the condition
     '''
     hashed = super(Compare, self).hash()
     return khash(hashed, self._comp_value, self._comp_type)
Example #13
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Calculated, self).hash()
     return khash(hashed, self._field_name)
Example #14
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(_LibraryBitField, self).hash()
     return khash(hashed, self._length, self._signed, self._min_value, self._max_value)
Example #15
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Repeat, self).hash()
     return khash(hashed, self._min_times, self._max_times, self._step, self._repeats)
Example #16
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(TakeFrom, self).hash()
     return khash(hashed, self.min_elements, self.max_elements, self.seed)
Example #17
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(RandomBytes, self).hash()
     return khash(hashed, self._min_length, self._max_length, self._num_mutations, self._step, self._seed)
Example #18
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Calculated, self).hash()
     return khash(hashed, self._field_name)
Example #19
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(TakeFrom, self).hash()
     return khash(hashed, self.min_elements, self.max_elements, self.seed)
Example #20
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Dynamic, self).hash()
     return khash(hashed, self._key, self._length)
Example #21
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(ForEach, self).hash()
     return khash(hashed + self._mutated_field.hash())
Example #22
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(BitField, self).hash()
     return khash(hashed, self._length, self._signed, self._min_value, self._max_value)
Example #23
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Pad, self).hash()
     return khash(hashed, self._pad_length, self._pad_data)
Example #24
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Dynamic, self).hash()
     return khash(hashed, self._key, self._length)
Example #25
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(String, self).hash()
     return khash(hashed, self._max_size)
Example #26
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the condition
     '''
     hashed = super(Compare, self).hash()
     return khash(hashed, self._comp_value, self._comp_type)
Example #27
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     self._initialize()
     hashed = khash(type(self).__name__, self._default_value, self._fuzzable)
     return hashed
Example #28
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     if self._hash is None:
         self._initialize()
         self._hash = khash(type(self).__name__, self._default_value, self._fuzzable)
     return self._hash
Example #29
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Container, self).hash()
     for f in self._fields:
         f_hashed = f.hash()
         hashed = khash(hashed + f_hashed)
     return hashed
Example #30
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Container, self).hash()
     for f in self._fields:
         f_hashed = f.hash()
         hashed = khash(hashed + f_hashed)
     return hashed
Example #31
0
File: graph.py Project: wflk/kitty
 def hash(self):
     hashed = super(GraphModel, self).hash()
     skeys = sorted(self._graph.keys())
     for key in skeys:
         for conn in self._graph[key]:
             t_hashed = conn.dst.hash()
             self.logger.info('hash of template %s is %s' % (conn.dst.get_name(), t_hashed))
             hashed = khash(hashed, t_hashed)
     self.logger.info('hash of model is %s' % hashed)
     return hashed
Example #32
0
 def hash(self):
     hashed = super(GraphModel, self).hash()
     skeys = sorted(self._graph.keys())
     for key in skeys:
         for conn in self._graph[key]:
             t_hashed = conn.dst.hash()
             self.logger.info("hash of template %s is %s" % (conn.dst.get_name(), t_hashed))
             hashed = khash(hashed, t_hashed)
     self.logger.info("hash of model is %s" % hashed)
     return hashed
Example #33
0
 def hash(self):
     hashed = None
     for stage in self._stages:
         hashed = khash(hashed, stage.hash())
     return hashed
Example #34
0
 def hash(self):
     hashed = super(BlockDuplicate, self).hash()
     return khash(hashed, self._num_dups)
Example #35
0
 def hash(self):
     hashed = super(RandomBytes, self).hash()
     return khash(hashed, self._min_length, self._max_length, self._num_mutations, self._step, self._seed)
Example #36
0
 def hash(self):
     hashed = super(Group, self).hash()
     return khash(hashed, frozenset(self._values))
Example #37
0
 def hash(self):
     hashed = super(String, self).hash()
     return khash(hashed, self._max_size)
Example #38
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the condition
     '''
     return khash(type(self).__name__)
Example #39
0
 def hash(self):
     hashed = super(BitFlip, self).hash()
     return khash(hashed, self._num_bits)
Example #40
0
 def hash(self):
     hashed = super(Compare, self).hash()
     return khash(hashed, self._comp_value, self._comp_type)
Example #41
0
 def hash(self):
     hashed = super(ListCondition, self).hash()
     return khash(hashed, len(self._value_list),
                  frozenset(self._value_list))
Example #42
0
 def hash(self):
     return khash(type(self).__name__)
Example #43
0
 def hash(self):
     hashed = super(FieldCondition, self).hash()
     return khash(hashed, self._field_name)
Example #44
0
 def hash(self):
     hashed = super(BitFlip, self).hash()
     return khash(hashed, self._num_bits)
Example #45
0
 def hash(self):
     hashed = khash(self._strategy, self._seed)
     for t in self._templates:
         hashed = khash(hashed, t.hash())
     return hashed
Example #46
0
 def hash(self):
     hashed = super(BlockDuplicate, self).hash()
     return khash(hashed, self._num_dups)
Example #47
0
 def hash(self):
     hashed = None
     for stage in self._stages:
         hashed = khash(hashed, stage.hash())
     return hashed
Example #48
0
 def hash(self):
     hashed = super(BlockOperation, self).hash()
     return khash(hashed, self._block_size)
Example #49
0
 def hash(self):
     return khash(self.get_name())
Example #50
0
 def hash(self):
     hashed = super(ByteFlip, self).hash()
     return khash(hashed, self._num_bytes)
Example #51
0
 def hash(self):
     self._get_ready()
     hashed = khash(type(self).__name__, self._default_value, self._fuzzable)
     return hashed
Example #52
0
 def hash(self):
     return khash(self.get_name())
Example #53
0
 def hash(self):
     hashed = super(BitField, self).hash()
     return khash(hashed, self._length, self._signed, self._min_value, self._max_value)
Example #54
0
 def hash(self):
     '''
     :return: a hash of the model object (used for notifying change in the model)
     '''
     return khash(type(self).__name__)
Example #55
0
 def hash(self):
     hashed = super(Dynamic, self).hash()
     return khash(hashed, self._key, self._length)
Example #56
0
 def hash(self):
     hashed = khash(self._strategy, self._seed)
     for t in self._templates:
         hashed = khash(hashed, t.hash())
     return hashed
Example #57
0
 def hash(self):
     hashed = super(Calculated, self).hash()
     return khash(hashed, self._field_name)
Example #58
0
 def hash(self):
     hashed = super(BlockOperation, self).hash()
     return khash(hashed, self._block_size)