Remove assumption of 26 as modulus

This commit is contained in:
Barry Brown 2024-06-13 06:49:14 +00:00
parent 7eb887ca51
commit 9c696b523d

View file

@ -1275,7 +1275,7 @@ class Utils {
static modInv(x, y) { static modInv(x, y) {
x %= y; x %= y;
for (let i = 1; i < y; i++) { for (let i = 1; i < y; i++) {
if ((x * i) % 26 === 1) { if ((x * i) % y === 1) {
return i; return i;
} }
} }