Org.BouncyCastle.Math.BigInteger.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
		public override bool Equals(
			object obj)
		{
			if (obj == this)
				return true;

			BigInteger biggie = obj as BigInteger;
			if (biggie == null)
				return false;

			if (biggie.sign != sign || biggie.magnitude.Length != magnitude.Length)
				return false;

			for (int i = 0; i < magnitude.Length; i++)
			{
				if (biggie.magnitude[i] != magnitude[i])
				{
					return false;
				}
			}

			return true;
		}

Usage Example

        static FixedSecureRandom()
        {
            M.BigInteger check1 = new M.BigInteger(128, new RandomChecker());
            M.BigInteger check2 = new M.BigInteger(120, new RandomChecker());

            isAndroidStyle   = check1.Equals(ANDROID);
            isRegularStyle   = check1.Equals(REGULAR);
            isClasspathStyle = check2.Equals(CLASSPATH);
        }
All Usage Examples Of Org.BouncyCastle.Math.BigInteger::Equals