Polynomial string hashing
Give each prefix of a word a number. These numbers help compare pieces of a long text. Different numbers mean different pieces. If the numbers match, you can check the letters.
Start at zero. Multiply the previous hash by 257, add the character code, and take the remainder modulo 1,000,003. Different strings can have the same hash.