Hash function and oracle method