compute hash for matches while scanning