mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Tidied operations to match conventions
This commit is contained in:
parent
2750be36da
commit
a153246191
4 changed files with 26 additions and 6 deletions
|
@ -927,8 +927,11 @@ var Utils = {
|
|||
a[key] = b[key];
|
||||
return a;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Actual modulo function, since % is actually the remainder function in JS
|
||||
*
|
||||
* @author Matt C [matt@artemisbot.pw]
|
||||
* @param {number} x
|
||||
* @param {number} y
|
||||
|
@ -937,8 +940,10 @@ var Utils = {
|
|||
return ((x % y) + y) % y;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Finds GCD of two numbers
|
||||
*
|
||||
* @author Matt C [matt@artemisbot.pw]
|
||||
* @param {number} x
|
||||
* @param {number} y
|
||||
|
@ -950,6 +955,14 @@ var Utils = {
|
|||
return Utils.gcd(y, x % y);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Finds modular inverse of two values
|
||||
*
|
||||
* @author Matt C [matt@artemisbot.pw]
|
||||
* @param {number} x
|
||||
* @param {number} y
|
||||
*/
|
||||
modInv: function(x, y) {
|
||||
x %= y;
|
||||
for (var i = 1; i < y; i++) {
|
||||
|
@ -959,6 +972,7 @@ var Utils = {
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* A mapping of names of delimiter characters to their symbols.
|
||||
* @constant
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue