I am looking to create a simple c++ hash function which will return a number within a max range based on a string input. So that, the same string will always return the same integer value. Here is an arbitrary example where the max desired range is 36.
Fred Smith -> 25
tree -> 34
Frog -> 0
Fred Smith -> 25
fred smith -> 7
These numbers are arbitrary, but the function should use an algorithm that does a numeric calculation against the string and results in an integer within a defined range. I will eventually rewrite this function for use in Python 2.7 as well.
I am using vs2008 (aka c++9) and std::hash is not available.
I need some advice on the approach.