예제 #1
0
파일: node_t.py 프로젝트: wenjun001/IOT
 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
예제 #2
0
파일: node_t.py 프로젝트: wenjun001/IOT
 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