to find any of a large number, say "k", fixed length patterns in a text, a simple variant of the rabin–karp algorithm uses a bloom filter or a set data structure to check whether the hash of a given string belongs to a set of hash values of patterns we are looking for: