Matching strings with hash functions