peterolson / BigInteger.js

An arbitrary length integer library for Javascript
The Unlicense
1.12k stars 187 forks source link

Reliable isProbablePrime #152

Closed oogFranz closed 6 years ago

oogFranz commented 6 years ago

Make isProbablePrime more reliable.

Miller-Rabin Test with random sampling can detect some pseudo primes as a composite number. And with my local testing, the new isProbablePrime() works as fast as the original one. ref. https://github.com/peterolson/BigInteger.js/pull/48#issue-45877579

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 99.418% when pulling a110a848bdbf9f227aa7d4dcba119a2c2d0111ef on oogFranz:reliable_isProbablePrime into cf6754e3ee8e447ca60430614d6e9a678a537f18 on peterolson:master.

peterolson commented 6 years ago

Thanks, looks good to me