'Return nonempty if the object exists in the index files.'

def exists(self, hash, want_source=False):

    global _total_searches, _total_steps
    _total_searches += 1
    want = str(hash)
    el = extract_bits(want, self.bits)
    if el:
        start = self._fanget((el - 1))
        startv = (el << (32 - self.bits))
    else:
        start = 0
        startv = 0
    end = self._fanget(el)
    endv = ((el + 1) << (32 - self.bits))
    _total_steps += 1
    hashv = _helpers.firstword(hash)
    while (start < end):
        _total_steps += 1
        mid = (start + (((hashv - startv) * ((end - start) - 1)) / (endv - startv)))
        v = self._get(mid)
        if (v < want):
            start = (mid + 1)
            startv = _helpers.firstword(v)
        elif (v > want):
            end = mid
            endv = _helpers.firstword(v)
        else:
            return ((want_source and self._get_idxname(mid)) or True)
    return None
