namespace AntDesign.Core.HashCodes { /// /// Provides a hash comparison of two parameter values /// /// static class HashCode { private static readonly HashCodeProvider _provider = HashCodeProvider.Create(typeof(TParameter)); /// /// Calculate whether the hash of two parameter values is equal /// /// Parameter 1 /// Parameter 2 /// public static bool HashCodeEquals(TParameter parameter1, TParameter parameter2) { return GetHashCode(parameter1) == GetHashCode(parameter2); } /// /// Calculate the hash value of the parameter /// /// Parameter /// public static int GetHashCode(TParameter parameter) { return _provider.GetHashCode(parameter); } } }