JavaScript:实现FermatPrimalityTest费马素数测试算法
/**
* Faster exponentiation that capitalize on the fact that we are only interested
* in the modulus of the exponentiation.
*
*
* @param {number} base
* @param {number} exponent
* @param {number} modulus
*/
const modularExponentiation = (base, exponent, modulus) => {