def _update(self, plusOrMinus, key): """ Update the entries in _hashTable. :param int plusOrMinus: The amount to update the count. :param int key: The key for computing the entry. """ bucketsPerHash = int(len(self._hashTable) / InvertibleBloomLookupTable.N_HASH) for i in range(InvertibleBloomLookupTable.N_HASH): startEntry = i * bucketsPerHash h = Common.murmurHash3Uint32(i, key) entry = self._hashTable[startEntry + (h % bucketsPerHash)] entry._count += plusOrMinus entry._keySum ^= key entry._keyCheck ^= Common.murmurHash3Uint32( InvertibleBloomLookupTable.N_HASHCHECK, key)
def _update(self, plusOrMinus, key): """ Update the entries in _hashTable. :param int plusOrMinus: The amount to update the count. :param int key: The key for computing the entry. """ bucketsPerHash = int( len(self._hashTable) / InvertibleBloomLookupTable.N_HASH) for i in range(InvertibleBloomLookupTable.N_HASH): startEntry = i * bucketsPerHash h = Common.murmurHash3Uint32(i, key) entry = self._hashTable[startEntry + (h % bucketsPerHash)] entry._count += plusOrMinus entry._keySum ^= key entry._keyCheck ^= Common.murmurHash3Uint32( InvertibleBloomLookupTable.N_HASHCHECK, key)
def isPure(self): """ :rtype: bool """ if self._count == 1 or self._count == -1: # Debug: Convert to check = Common.murmurHash3Uint32( InvertibleBloomLookupTable.N_HASHCHECK, self._keySum) return self._keyCheck == check return False
def isPure(self): """ :rtype: bool """ if self._count == 1 or self._count == -1: # Debug: Convert to check = Common.murmurHash3Uint32( InvertibleBloomLookupTable.N_HASHCHECK, self._keySum) return self._keyCheck == check return False