Beispiel #1
0
 def _get_packed_fingerprint():
     if node_t._packed_fingerprint is None:
         node_t._packed_fingerprint = struct.pack(">Q", node_t._get_hash_recursive([]))
     return node_t._packed_fingerprint
Beispiel #2
0
 def _get_hash_recursive(parents):
     if node_t in parents: return 0
     newparents = parents + [node_t]
     tmphash = (0x98ff4a363aeb7273+ node_t._get_hash_recursive(newparents)) & 0xffffffffffffffff
     tmphash  = (((tmphash<<1)&0xffffffffffffffff)  + (tmphash>>63)) & 0xffffffffffffffff
     return tmphash