Modular Arithmetic API
Modular-arithmetic maths as an API, computed locally and deterministically with exact big-integer arithmetic. The power endpoint computes modular exponentiation, aᵇ mod m, by square-and-multiply, fast and exact even for the huge exponents used in cryptography. The inverse endpoint finds the modular multiplicative inverse a⁻¹ mod m with the extended Euclidean algorithm, returning the inverse when a and m are coprime and reporting the gcd when no inverse exists. The totient endpoint computes Euler's totient φ(n) — the count of integers from 1 to n coprime to n — with the prime factorization it comes from, and an optional Euler-theorem check that a^φ(n) ≡ 1 (mod n) for a coprime base. These are the building blocks of RSA and much of modern cryptography. Inputs are integers and can be passed as strings for very large values. Everything is computed locally and deterministically, so it is instant and private. Ideal for cryptography, security, blockchain and mathematics app developers, RSA and number-theory tools, and computer-science education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is modular arithmetic; for prime factorization and GCD use a number-theory API and for integer sequences a sequences API.
api.oanor.com/modular-api