The Rabin Karp string matching algorithm has two versions that use hashing to determine if a pattern string exists within a text string. Version 1 assigns numeric weights to each character and sums the weights to generate a hash. Version 2 converts the string to a number in a given numeric base. Both versions calculate the hash of the pattern and slide it through the text, recomputing the hash at each position to check for a match. The complexity depends on the hash function used but can be O(n-m+1) in the best case where n and m are the string lengths.