Rabin-Karp as a function.