in computer science, the rabin–karp algorithm or karp–rabin algorithm is a string-searching algorithm created by that uses hashing to find an exact match of a pattern string in a text. it uses a rolling hash to quickly filter out positions of the text that cannot match the pattern, and then checks for a match at the remaining positions. generalizations of the same idea can be used to find more than one match of a single pattern, or to find matches for more than one pattern.