mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
Remove assumption of 26 as modulus
This commit is contained in:
parent
7eb887ca51
commit
9c696b523d
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue