compute rolling hashes