Exemplo n.º 1
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Group, self).hash()
     return khash(hashed, frozenset(self._values))
Exemplo n.º 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)
Exemplo n.º 3
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(String, self).hash()
     return khash(hashed, self._max_size)
Exemplo n.º 4
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Conditional, self).hash()
     return khash(hashed, self._condition.hash())
Exemplo n.º 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)
Exemplo n.º 6
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Group, self).hash()
     return khash(hashed, frozenset(self._values))
Exemplo n.º 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)
Exemplo n.º 8
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Trunc, self).hash()
     return khash(hashed, self._max_size)
Exemplo n.º 9
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(ForEach, self).hash()
     return khash(hashed + self._mutated_field.hash())
Exemplo n.º 10
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Conditional, self).hash()
     return khash(hashed, self._condition.hash())
Exemplo n.º 11
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(Trunc, self).hash()
     return khash(hashed, self._max_size)
Exemplo n.º 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)
Exemplo n.º 13
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Calculated, self).hash()
     return khash(hashed, self._field_name)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 18
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Calculated, self).hash()
     return khash(hashed, self._field_name)
Exemplo n.º 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)
Exemplo n.º 20
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Dynamic, self).hash()
     return khash(hashed, self._key, self._length)
Exemplo n.º 21
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the container
     '''
     hashed = super(ForEach, self).hash()
     return khash(hashed + self._mutated_field.hash())
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 24
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(Dynamic, self).hash()
     return khash(hashed, self._key, self._length)
Exemplo n.º 25
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the field
     '''
     hashed = super(String, self).hash()
     return khash(hashed, self._max_size)
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 31
0
Arquivo: graph.py Projeto: 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
Exemplo n.º 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
Exemplo n.º 33
0
 def hash(self):
     hashed = None
     for stage in self._stages:
         hashed = khash(hashed, stage.hash())
     return hashed
Exemplo n.º 34
0
 def hash(self):
     hashed = super(BlockDuplicate, self).hash()
     return khash(hashed, self._num_dups)
Exemplo n.º 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)
Exemplo n.º 36
0
 def hash(self):
     hashed = super(Group, self).hash()
     return khash(hashed, frozenset(self._values))
Exemplo n.º 37
0
 def hash(self):
     hashed = super(String, self).hash()
     return khash(hashed, self._max_size)
Exemplo n.º 38
0
 def hash(self):
     '''
     :rtype: int
     :return: hash of the condition
     '''
     return khash(type(self).__name__)
Exemplo n.º 39
0
 def hash(self):
     hashed = super(BitFlip, self).hash()
     return khash(hashed, self._num_bits)
Exemplo n.º 40
0
 def hash(self):
     hashed = super(Compare, self).hash()
     return khash(hashed, self._comp_value, self._comp_type)
Exemplo n.º 41
0
 def hash(self):
     hashed = super(ListCondition, self).hash()
     return khash(hashed, len(self._value_list),
                  frozenset(self._value_list))
Exemplo n.º 42
0
 def hash(self):
     return khash(type(self).__name__)
Exemplo n.º 43
0
 def hash(self):
     hashed = super(FieldCondition, self).hash()
     return khash(hashed, self._field_name)
Exemplo n.º 44
0
 def hash(self):
     hashed = super(BitFlip, self).hash()
     return khash(hashed, self._num_bits)
Exemplo n.º 45
0
 def hash(self):
     hashed = khash(self._strategy, self._seed)
     for t in self._templates:
         hashed = khash(hashed, t.hash())
     return hashed
Exemplo n.º 46
0
 def hash(self):
     hashed = super(BlockDuplicate, self).hash()
     return khash(hashed, self._num_dups)
Exemplo n.º 47
0
 def hash(self):
     hashed = None
     for stage in self._stages:
         hashed = khash(hashed, stage.hash())
     return hashed
Exemplo n.º 48
0
 def hash(self):
     hashed = super(BlockOperation, self).hash()
     return khash(hashed, self._block_size)
Exemplo n.º 49
0
 def hash(self):
     return khash(self.get_name())
Exemplo n.º 50
0
 def hash(self):
     hashed = super(ByteFlip, self).hash()
     return khash(hashed, self._num_bytes)
Exemplo n.º 51
0
 def hash(self):
     self._get_ready()
     hashed = khash(type(self).__name__, self._default_value, self._fuzzable)
     return hashed
Exemplo n.º 52
0
 def hash(self):
     return khash(self.get_name())
Exemplo n.º 53
0
 def hash(self):
     hashed = super(BitField, self).hash()
     return khash(hashed, self._length, self._signed, self._min_value, self._max_value)
Exemplo n.º 54
0
 def hash(self):
     '''
     :return: a hash of the model object (used for notifying change in the model)
     '''
     return khash(type(self).__name__)
Exemplo n.º 55
0
 def hash(self):
     hashed = super(Dynamic, self).hash()
     return khash(hashed, self._key, self._length)
Exemplo n.º 56
0
 def hash(self):
     hashed = khash(self._strategy, self._seed)
     for t in self._templates:
         hashed = khash(hashed, t.hash())
     return hashed
Exemplo n.º 57
0
 def hash(self):
     hashed = super(Calculated, self).hash()
     return khash(hashed, self._field_name)
Exemplo n.º 58
0
 def hash(self):
     hashed = super(BlockOperation, self).hash()
     return khash(hashed, self._block_size)