System.Uri.CalculateCaseInsensitiveHashCode C# (CSharp) Method

CalculateCaseInsensitiveHashCode() static private method

static private CalculateCaseInsensitiveHashCode ( string text ) : int
text string
return int
        internal static int CalculateCaseInsensitiveHashCode(string text)
        {
            return text.ToLowerInvariant().GetHashCode();
        }

Usage Example

Example #1
0
        // methods

        private void CalculateHashCode()
        {
            //
            // default is case-sensitive hash-code generation because for DNS
            // names, IPv6 and IPv4 addresses, we have already canonicalized
            // the string, including converting to a standard case
            //

            if (Name.Length > 0)
            {
                m_HashCode = Uri.CalculateCaseInsensitiveHashCode(Name);
            }
        }