public static int calcHash(char[] buffer,int start,int len){
  int hash=(int)buffer[0];
  for (int i=1; i < len; ++i) {
    hash=(hash * 31) + (int)buffer[i];
  }
  return hash;
}

public static int calcHash ( char [ ] buffer , int start , int len ) { int hash = ( int ) buffer [ 0 ] ; for ( int i = 1 ; i < len ; ++ i ) { hash = ( hash * 31 ) + ( int ) buffer [ i ] ; } return hash ; }
implementation of a hashing method for variable length strings . most of the time intention is that this calculation is done by caller during parsing , not here ; however , sometimes it needs to be done for parsed " string " too .
