Untill calculating hashes for pattern and string