theoretically, there exist other algorithms that could provide convenient recomputation, e.g. multiplying together ascii values of all characters so that shifting substring would only entail dividing the previous hash by the first character value, then multiplying by the new last character's value. the limitation, however, is the limited size of the integer data type and the necessity of using modular arithmetic to scale down the hash results, (see hash function article). meanwhile, naive hash functions do not produce large numbers quickly, but, just like adding ascii values, are likely to cause many hash collisions and hence slow down the algorithm. hence the described hash function is typically the preferred one in the rabin–karp algorithm.