Help


from Wikipedia
« »  
For example, if we have text " abracadabra " and we are searching for a pattern of length 3, we can compute the hash of " bra " from the hash for " abr " ( the previous substring ) by subtracting the number added for the first ' a ' of " abr ", i. e. 97 × 101 < sup > 2 </ sup > ( 97 is ASCII for ' a ' and 101 is the base we are using ), multiplying by the base and adding for the last a of " bra ", i. e. 97 × 101 < sup > 0 </ sup > = 97.
If the substrings in question are long, this algorithm achieves great savings compared with many other hashing schemes.

1.849 seconds.