Here you can find the source of hashCode(char[] array, int start, int end)
public static int hashCode(char[] array, int start, int end)
//package com.java2s; /**/*from w ww .j a va2s . c o m*/ * @(#)ArrayUtil.java, 2013-2-24. * * Copyright 2013 Netease, Inc. All rights reserved. * NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ public class Main { /** * Returns hash of chars in range start (inclusive) to end (inclusive) */ public static int hashCode(char[] array, int start, int end) { int code = 0; for (int i = end - 1; i >= start; i--) { code = code * 31 + array[i]; } return code; } /** * Returns hash of chars in range start (inclusive) to end (inclusive) */ public static int hashCode(byte[] array, int start, int end) { int code = 0; for (int i = end - 1; i >= start; i--) { code = code * 31 + array[i]; } return code; } }