Ejemplo n.º 1
0
 public override int GetHashCode()
 {
     return
         (Top.GetHashCode() ^ PGUtil.RotateShift(Right.GetHashCode(), sizeof(int) / 4) ^
          PGUtil.RotateShift(Bottom.GetHashCode(), sizeof(int) / 2) ^
          PGUtil.RotateShift(LowerLeft.GetHashCode(), sizeof(int) * 3 / 4));
 }
Ejemplo n.º 2
0
        public override int GetHashCode()
        {
            var ret = 266370105;//seed with something other than zero to make paths of all zeros hash differently.

            for (var i = 0; i < _geometries.Length; i++)
            {
                ret ^= PGUtil.RotateShift(_geometries[i].GetHashCode(), ret % sizeof(int));
            }
            return(ret);
        }
Ejemplo n.º 3
0
        public override int GetHashCode()
        {
            int ret = 266370105;//seed with something other than zero to make paths of all zeros hash differently.

            foreach (NpgsqlPoint point in this)
            {
                //The ideal amount to shift each value is one that would evenly spread it throughout
                //the resultant bytes. Using the current result % 32 is essentially using a random value
                //but one that will be the same on subsequent calls.
                ret ^= PGUtil.RotateShift(point.GetHashCode(), ret % sizeof(int));
            }
            return(ret);
        }
Ejemplo n.º 4
0
        public override int GetHashCode()
        {
            switch (_type)
            {
            case InternalType.Infinity:
                return(int.MaxValue);

            case InternalType.NegativeInfinity:
                return(int.MinValue);

            default:
                return(_date.GetHashCode() ^ PGUtil.RotateShift(_time.GetHashCode(), 16));
            }
        }
Ejemplo n.º 5
0
 public override int GetHashCode()
 {
     return(PGUtil.RotateShift(Address.GetHashCode(), Netmask % 32));
 }
Ejemplo n.º 6
0
 public override int GetHashCode()
 {
     return(X.GetHashCode() ^ PGUtil.RotateShift(Y.GetHashCode(), sizeof(int) / 2));
 }
Ejemplo n.º 7
0
 public override int GetHashCode()
 {
     return
         (Start.X.GetHashCode() ^ PGUtil.RotateShift(Start.Y.GetHashCode(), sizeof(int) / 4) ^
          PGUtil.RotateShift(End.X.GetHashCode(), sizeof(int) / 2) ^ PGUtil.RotateShift(End.Y.GetHashCode(), sizeof(int) * 3 / 4));
 }
Ejemplo n.º 8
0
        // ReSharper restore CompareOfFloatsByEqualityOperator

        public override int GetHashCode()
        => X.GetHashCode() ^ PGUtil.RotateShift(Y.GetHashCode(), sizeof(int) / 2);
Ejemplo n.º 9
0
 public override int GetHashCode()
 {
     return(PGUtil.RotateShift(addr.GetHashCode(), mask % 32));
 }
Ejemplo n.º 10
0
 public override int GetHashCode()
 {
     return
         (Center.X.GetHashCode() ^ PGUtil.RotateShift(Center.Y.GetHashCode(), sizeof(int) / 4) ^
          PGUtil.RotateShift(Radius.GetHashCode(), sizeof(int) / 2));
 }
Ejemplo n.º 11
0
        public override int GetHashCode()
        {
            int ret = 266370105;  //seed with something other than zero to make paths of all zeros hash differently.

            return(PGUtil.RotateShift(macAddr.GetHashCode(), ret));
        }
Ejemplo n.º 12
0
 public override int GetHashCode()
 => X.GetHashCode() ^ PGUtil.RotateShift(Y.GetHashCode(), PGUtil.BitsInInt / 2);
Ejemplo n.º 13
0
 public override int GetHashCode()
 => Top.GetHashCode() ^
 PGUtil.RotateShift(Right.GetHashCode(), PGUtil.BitsInInt / 4) ^
 PGUtil.RotateShift(Bottom.GetHashCode(), PGUtil.BitsInInt / 2) ^
 PGUtil.RotateShift(LowerLeft.GetHashCode(), PGUtil.BitsInInt * 3 / 4);
Ejemplo n.º 14
0
 public override int GetHashCode()
 => Start.X.GetHashCode() ^
 PGUtil.RotateShift(Start.Y.GetHashCode(), PGUtil.BitsInInt / 4) ^
 PGUtil.RotateShift(End.X.GetHashCode(), PGUtil.BitsInInt / 2) ^
 PGUtil.RotateShift(End.Y.GetHashCode(), PGUtil.BitsInInt * 3 / 4);
Ejemplo n.º 15
0
 public override int GetHashCode()
 => PGUtil.RotateShift(Address.GetHashCode(), Netmask % 32);