public static final long computeHashCode ( String str , boolean modifyAlgorithm ) { // d179573 Ends // to avoid EBCDIC / ASCII / Unicdoe encoding difference (i.e. z/OS390) // uses toCharArray() instead of getBytes(). char chars [ ] = str . toCharArray ( ) ; // Corrected the algorithm to more closely match the 'buzHash' // algorithm it is patterned from and produce both a 64 and 32 // bit value (64 bit value may be better). long h = initial_hash ; for ( int i = 0 ; i < chars . length ; ++ i ) { // d179573 Begins char thisChar = chars [ i ] ; if ( modifyAlgorithm ) { // for all recurrences of the same character in a multiple 64 positions // before the current index, need to mix/scramble the hash to another iteration. // d183360 Begins int j = i ; while ( j > 0 ) { if ( j >= 64 && thisChar == chars [ j - 64 ] ) { thisChar ^= mix_master [ thisChar & 0xff ] ; } j -= 64 ; } // d183360 Ends } h = ( ( h << 1 ) | ( h >>> 63 ) ) ^ mix_master [ thisChar & 0xff ] ; // d179573 Ends } return h ; }
are the same .