4 ms·
Behold, MR.Prime! https://github.com/rkneufeld/mr_prime https://github.com/rkneufeld/mr_prime It's a little ruby Miller-Rabin primality tester I wrote with my
by rkneufeld 16y ago
Behold, MR.Prime!
https://github.com/rkneufeld/mr_prime https://github.com/rkneufeld/mr_prime
It's a little ruby Miller-Rabin primality tester I wrote with my friend in Crypto class that can handle ~500 digit primes in less than a few seconds. I think my friend also wrote a C extension for it - super fast.
Edit: spelling.
- eqdw 16y agoIIRC, it was sub-second speed when he was done optimizing. I wrote a non-optimized version of this in Ruby, ran in ~10sec. Then I rewrote it in C, and it was <1ms runtime for 20-100 digit inputs. Yay algorithms!