Пример #1
0
        public override int GetHashCode()
        {
            var hashCode = 291051517;

            hashCode = hashCode * -1521134295 + Int.GetHashCode();
            hashCode = hashCode * -1521134295 + Long.GetHashCode();
            hashCode = hashCode * -1521134295 + Short.GetHashCode();
            hashCode = hashCode * -1521134295 + UInt.GetHashCode();
            hashCode = hashCode * -1521134295 + ULong.GetHashCode();
            hashCode = hashCode * -1521134295 + UShort.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <int?> .Default.GetHashCode(NullableInt);

            hashCode = hashCode * -1521134295 + Byte.GetHashCode();
            hashCode = hashCode * -1521134295 + SByte.GetHashCode();
            hashCode = hashCode * -1521134295 + Bool.GetHashCode();
            hashCode = hashCode * -1521134295 + Float.GetHashCode();
            hashCode = hashCode * -1521134295 + Double.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <byte[]> .Default.GetHashCode(ByteArray);

            hashCode = hashCode * -1521134295 + Decimal.GetHashCode();
            hashCode = hashCode * -1521134295 + DateTime.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(String);

            return(hashCode);
        }
Пример #2
0
 public override int GetHashCode()
 {
     return(
         Test?.GetHashCode() ?? 0 ^
         Int.GetHashCode() ^
         String?.GetHashCode() ?? 0 ^
         Float.GetHashCode());
 }
Пример #3
0
        public override int GetHashCode()
        {
            int hashCode = 2115060958;

            hashCode = hashCode * -1521134295 + Int.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Str);

            return(hashCode);
        }
Пример #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Date.GetHashCode();
         hashCode = (hashCode * 397) ^ Int.GetHashCode();
         hashCode = (hashCode * 397) ^ Int2.GetHashCode();
         hashCode = (hashCode * 397) ^ Complex.GetHashCode();
         return(hashCode);
     }
 }
Пример #5
0
        public override int GetHashCode()
        {
            var hash = 19;

            hash = hash * 7 + Bool.GetHashCode();
            hash = hash * 7 + Int.GetHashCode();
            hash = hash * 7 + UInt.GetHashCode();
            hash = hash * 7 + Float.GetHashCode();
            hash = hash * 7 + Char.GetHashCode();
            hash = hash * 7 + Str.GetHashCode();

            return(hash);
        }
Пример #6
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Byte.GetHashCode();
         hashCode = (hashCode * 397) ^ SByte.GetHashCode();
         hashCode = (hashCode * 397) ^ Short.GetHashCode();
         hashCode = (hashCode * 397) ^ UShort.GetHashCode();
         hashCode = (hashCode * 397) ^ Int.GetHashCode();
         hashCode = (hashCode * 397) ^ UInt.GetHashCode();
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ ULong.GetHashCode();
         return(hashCode);
     }
 }
Пример #7
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Byte != null ? Byte.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SByte != null ? SByte.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Short != null ? Short.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (UShort != null ? UShort.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Int != null ? Int.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (UInt != null ? UInt.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Long != null ? Long.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ULong != null ? ULong.GetHashCode() : 0);
         return(hashCode);
     }
 }
Пример #8
0
        public override int GetHashCode()
        {
            switch (_type)
            {
            case TokenType.Boolean:
                return(Boolean.GetHashCode());

            case TokenType.Number:
                return(Int.GetHashCode());

            case TokenType.String:
                return(String.GetHashCode());
            }
            return((int)_type);
        }
Пример #9
0
 public override int GetHashCode()
 {
     return(1497029550 + Int.GetHashCode());
 }
            public override int GetHashCode()
            {
                unchecked
                {
                    // Choose large primes to avoid hashing collisions
                    const int HashingBase       = (int)2166136261;
                    const int HashingMultiplier = 16777619;

                    int hash = HashingBase;
                    hash = (hash * HashingMultiplier) ^ (!Object.ReferenceEquals(null, Int) ? Int.GetHashCode() : 0);
                    hash = (hash * HashingMultiplier) ^ (!Object.ReferenceEquals(null, Double) ? Double.GetHashCode() : 0);
                    hash = (hash * HashingMultiplier) ^ (!Object.ReferenceEquals(null, String) ? String.GetHashCode() : 0);
                    return(hash);
                }
            }