I've written a method to hash a String into a long, like so:
Expand|Select|Wrap|Line Numbers
- private static long stringToHash(String str){
- long h = 0;
- for (int i = 0; i < str.length(); ++i)
- h = 31 * h + str.charAt(i);
- return h;
- }
Can anyone help?
Regards.