Home▸Algorithms & AI▸Rabin-Karp Rolling Hash String Search: Window Hash, Collisions and Spurious Hits

Rabin-Karp Rolling Hash String Search: Window Hash, Collisions and Spurious Hits

A belt of wooden letter tiles slides under a brass reading frame while a rolling polynomial hash is updated in constant time per step. Change the text length, pattern length, alphabet, base and modulus to see hash hits, true matches, spurious collisions and how many letter comparisons Rabin-Karp saves against the naive search. Blender-built tiles and frame, with numerical checks built in.

Algorithms & AI3DAdvanced60 FPS📱 Mobile-adapted🟠 Blender⇄ 2D version
Rabin-Karp Rolling Hash String Search: Window Hash, Collisions and Spurious Hits ↗ Open standalone

A belt of wooden letter tiles slides under a brass reading frame while a rolling polynomial hash is updated in constant time per step. Change the text length, pattern length, alphabet, base and modulus to see hash hits, true matches, spurious collisions and how many letter comparisons Rabin-Karp saves against the naive search. Blender-built tiles and frame, with numerical checks built in.

⚙ Under the hood

A belt of wooden letter tiles slides under a brass reading frame while a rolling polynomial hash is updated in constant time per step. Change the text length, pattern length, alphabet, base and modulus to see hash hits, true matches, spurious collisions and how many letter comparisons Rabin-Karp saves against the naive search. Blender-built tiles and frame, with numerical checks built in.

string matchinghashingalgorithmpattern searchRabin-KarpRolling HashString SearchHash CollisionsAlgorithms

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)