Here you can find the source of hashString(String str)
public static int hashString(String str)
//package com.java2s; //License from project: Open Source License public class Main { public static int hashString(String str) { // See http://stackoverflow.com/questions/2624192/good-hash-function-for-strings int hash = 7; for (int i = 0; i < str.length(); i++) { hash = hash * 31 + str.charAt(i); }/* w w w . j a v a 2 s.c o m*/ return hash; } }