code: function modPow(base, exponent, modulus) {
  
      let result = 1;
  
      while (exponent > 0) {
          if ((exponent & 1) === 1) {
              // multiply in this bit's contribution while using modulus to keep result small
              result = (result * base) % modulus;
          }
          // move to the next bit of the exponent, square (and mod) the base accordingly
          exponent = exponent >>> 1;
          base = (base * base) % modulus;
      }
  
      return result;
  }
docs: non strict implementation of some number theory algorithms
  used sources:
  https://en.wikipedia.org/wiki/Modular_exponentiation
  https://stackoverflow.com
  
   
  returns base ^ exponent % modulus
  @param base
  @param exponent
  @param modulus
  @returns {number}