timkurvers / as3-crypto

Fork of Henri Torgemane's excellent as3 cryptography library
http://code.google.com/p/as3crypto
Other
93 stars 46 forks source link

Zero Unequal? #25

Open etmiranda opened 7 years ago

etmiranda commented 7 years ago

I'm not extremely familiar with BigInteger usage, so I apologize if I'm asking something silly. But I'm finding that zero is not always equal to zero, which I thought it should be. Perhaps I'll need to make my own ZERO constant, but I figured I'd try asking here first.

In short, this: new BigInteger("0", 10) Does not equal: BigInteger.ZERO

Is that expected?

timkurvers commented 7 years ago

Hi there! Agreed, that sounds very strange. What method of comparison are you using in the test? == or BigInteger#equals?

etmiranda commented 7 years ago

Using the BigInteger.equals method.

timkurvers commented 7 years ago

Thanks @etmiranda! It seems to be a known issue included in the upstream issue overview.

Unfortunately that means that no-one has actually gotten around to fixing it yet. It may have been fixed in a separate fork though.