2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 5 Mar 2010 02:42:07 +0000 (02:42 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 5 Mar 2010 02:42:07 +0000 (02:42 -0000)
* BigInteger.cs: GetHashCode.

svn path=/trunk/mcs/; revision=153068

mcs/class/System.Numerics/System.Numerics/BigInteger.cs
mcs/class/System.Numerics/System.Numerics/ChangeLog

index 8cd5fed22802115b40ac9321657ce65b0683a900..b8ee238bf59151f171d274029094ff42bf7a64a1 100644 (file)
@@ -314,6 +314,15 @@ namespace System.Numerics {
                        return true;
                }
 
+               public override int GetHashCode ()
+               {
+                       uint hash = (uint)(sign * 0x01010101u);
+
+                       for (int i = 0; i < data.Length; ++i)
+                               hash ^= data [i];
+                       return (int)hash;
+               }
+
                static int TopByte (uint x)
                {
                        if ((x & 0xFFFF0000u) != 0) {
index 495b0277c2efebc2b99058b1026b0dd947960657..e1012e3c4a705ac9739fa58133ce337d71115e6a 100644 (file)
@@ -1,3 +1,7 @@
+2010-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * BigInteger.cs: GetHashCode.
+
 2010-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * BigInteger.cs: Equals.