System.Security.PermissionTokenKeyComparer.GetHashCode C# (CSharp) Méthode

GetHashCode() public méthode

public GetHashCode ( Object obj ) : int
obj Object
Résultat int
        public int GetHashCode( Object obj )
        {
            String str = obj as String;

            if (str == null)
                return obj.GetHashCode();

            int iComma = str.IndexOf( ',' );
            if (iComma == -1)
                iComma = str.Length;

            int accumulator = 0;
            for (int i = 0; i < iComma; ++i)
            {
                accumulator = (accumulator << 7) ^ str[i] ^ (accumulator >> 25);
            }

            return accumulator;
        }
    }