CyberChef
CyberChef copied to clipboard
More efficient modular inverse
Replaces the existing brute-force modular inverse function with a more efficient one that uses the Extended Euclidean Algorithm.
https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm
Retains backward compatibility by returning undefined
if the modular inverse cannot be found, although a better return value would probably be null
.