Mental Model
We use a rolling number code for each part of the text to quickly find where the pattern matches. Instead of checking every letter, we compare these codes.
Analogy: Imagine you want to find a word in a book by checking the sum of letter values instead of reading every letter. If the sums match, you check the word carefully.
Text: T -> h -> i -> s -> -> i -> s -> -> a -> -> t -> e -> x -> t -> null Pattern: ↑ ↑ ↑ ↑ Hash window: [hash of 'This']