Exemple #1
0
        /**
         * Returns a hash code for this string. The hash code for a
         * String object is computed as
         *
         * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
         *
         * using int arithmetic, where s[i] is the
         * i th character of the string, n is the length of
         * the string, and ^ indicates exponentiation.
         * (The hash value of the empty string is zero.)
         *
         * @return a hash code value for this object.
         *
         *  This extension method use the JAVA 5 String class hash code
         *  algorithm to compute the JAVA hash
         */

        public static Int32 GetJavaHashCode(this String value)
        {
            return(HashCodeHelper.ToJavaHashCode(value));
        }