Here you can find the source of hashCode(CharSequence seq)
public static int hashCode(CharSequence seq)
//package com.java2s; //License from project: Apache License public class Main { public static int hashCode(CharSequence seq) { final int prime = 31; int result = 1; for (int i = 0, len = seq.length(); i < len; i++) { result = prime * result + seq.charAt(i); }/* w w w.j ava2 s .c o m*/ return result; } }