Implement make_hashes as a generator

Can eliminate hashes if key is found early. Result is 30% faster.