|
@@ -27,7 +27,13 @@ class Model(object):
|
27
|
27
|
self.load()
|
28
|
28
|
|
29
|
29
|
def __hash__(self):
|
30
|
|
- return int(hashlib.md5(str({uid: component.__hash__ for uid, component in self._components.items()}).encode('utf-8')).hexdigest(),16)
|
|
30
|
+ components_dump = ""
|
|
31
|
+ for _, comp in self._components['uids'].items():
|
|
32
|
+ components_dump += str(hash(comp))
|
|
33
|
+ h = hashlib.new('sha512')
|
|
34
|
+ h.update(components_dump.encode('utf-8'))
|
|
35
|
+ return int(h.hexdigest(), 16)
|
|
36
|
+
|
31
|
37
|
|
32
|
38
|
def __eq__(self, other):
|
33
|
39
|
return self.__hash__() == other.__hash__()
|