If you think about it the right way, that's what everyone is doing: calculating a hash from the problem statement into stream of symbols with certain constraints.
So the problem here is not calculating hash functions per se, but over-fitting the solution to those test cases.