Moved ops to different modules

This commit is contained in:
n1474335 2024-04-05 18:10:14 +01:00
parent 1b870e559e
commit ed930d2364
No known key found for this signature in database
GPG Key ID: D15457B7B4AF3F37
7 changed files with 15 additions and 26 deletions

View File

@ -388,7 +388,6 @@
"SHA2",
"SHA3",
"SM3",
"MurmurHash3",
"Keccak",
"Shake",
"RIPEMD",
@ -413,6 +412,7 @@
"Scrypt",
"NT Hash",
"LM Hash",
"MurmurHash3",
"Fletcher-8 Checksum",
"Fletcher-16 Checksum",
"Fletcher-32 Checksum",

View File

@ -100,7 +100,7 @@ class ChaCha extends Operation {
super();
this.name = "ChaCha";
this.module = "Default";
this.module = "Ciphers";
this.description = "ChaCha is a stream cipher designed by Daniel J. Bernstein. It is a variant of the Salsa stream cipher. Several parameterizations exist; 'ChaCha' may refer to the original construction, or to the variant as described in RFC-8439. ChaCha is often used with Poly1305, in the ChaCha20-Poly1305 AEAD construction.<br><br><b>Key:</b> ChaCha uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> ChaCha uses a nonce of 8 or 12 bytes (64 or 96 bits).<br><br><b>Counter:</b> ChaCha uses a counter of 4 or 8 bytes (32 or 64 bits); together, the nonce and counter must add up to 16 bytes. The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.";
this.infoURL = "https://wikipedia.org/wiki/Salsa20#ChaCha_variant";
this.inputType = "string";

View File

@ -22,7 +22,7 @@ class MurmurHash3 extends Operation {
super();
this.name = "MurmurHash3";
this.module = "Default";
this.module = "Hashing";
this.description = "Generates a MurmurHash v3 for a string input and an optional seed input";
this.infoURL = "https://wikipedia.org/wiki/MurmurHash";
this.inputType = "string";
@ -115,11 +115,7 @@ class MurmurHash3 extends Operation {
* @return {number} 32-bit signed integer
*/
unsignedToSigned(value) {
if (value & 0x80000000) {
return -0x100000000 + value;
} else {
return value;
}
return value & 0x80000000 ? -0x100000000 + value : value;
}
/**

View File

@ -20,7 +20,7 @@ class RisonDecode extends Operation {
super();
this.name = "Rison Decode";
this.module = "Default";
this.module = "Encodings";
this.description = "Rison, a data serialization format optimized for compactness in URIs. Rison is a slight variation of JSON that looks vastly superior after URI encoding. Rison still expresses exactly the same set of data structures as JSON, so data can be translated back and forth without loss or guesswork.";
this.infoURL = "https://github.com/Nanonid/rison";
this.inputType = "string";
@ -29,11 +29,7 @@ class RisonDecode extends Operation {
{
name: "Decode Option",
type: "editableOption",
value: [
{ name: "Decode", value: "Decode", },
{ name: "Decode Object", value: "Decode Object", },
{ name: "Decode Array", value: "Decode Array", },
]
value: ["Decode", "Decode Object", "Decode Array"]
},
];
}
@ -52,8 +48,9 @@ class RisonDecode extends Operation {
return rison.decode_object(input);
case "Decode Array":
return rison.decode_array(input);
default:
throw new OperationError("Invalid Decode option");
}
throw new OperationError("Invalid Decode option");
}
}

View File

@ -20,7 +20,7 @@ class RisonEncode extends Operation {
super();
this.name = "Rison Encode";
this.module = "Default";
this.module = "Encodings";
this.description = "Rison, a data serialization format optimized for compactness in URIs. Rison is a slight variation of JSON that looks vastly superior after URI encoding. Rison still expresses exactly the same set of data structures as JSON, so data can be translated back and forth without loss or guesswork.";
this.infoURL = "https://github.com/Nanonid/rison";
this.inputType = "Object";
@ -28,13 +28,8 @@ class RisonEncode extends Operation {
this.args = [
{
name: "Encode Option",
type: "editableOption",
value: [
{ name: "Encode", value: "Encode", },
{ name: "Encode Object", value: "Encode Object", },
{ name: "Encode Array", value: "Encode Array", },
{ name: "Encode URI", value: "Encode URI", }
]
type: "option",
value: ["Encode", "Encode Object", "Encode Array", "Encode URI"]
},
];
}
@ -55,8 +50,9 @@ class RisonEncode extends Operation {
return rison.encode_array(input);
case "Encode URI":
return rison.encode_uri(input);
default:
throw new OperationError("Invalid encode option");
}
throw new OperationError("Invalid encode option");
}
}

View File

@ -22,7 +22,7 @@ class Salsa20 extends Operation {
super();
this.name = "Salsa20";
this.module = "Default";
this.module = "Ciphers";
this.description = "Salsa20 is a stream cipher designed by Daniel J. Bernstein and submitted to the eSTREAM project; Salsa20/8 and Salsa20/12 are round-reduced variants. It is closely related to the ChaCha stream cipher.<br><br><b>Key:</b> Salsa20 uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> Salsa20 uses a nonce of 8 bytes (64 bits).<br><br><b>Counter:</b> Salsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.";
this.infoURL = "https://wikipedia.org/wiki/Salsa20";
this.inputType = "string";

View File

@ -22,7 +22,7 @@ class XSalsa20 extends Operation {
super();
this.name = "XSalsa20";
this.module = "Default";
this.module = "Ciphers";
this.description = "XSalsa20 is a variant of the Salsa20 stream cipher designed by Daniel J. Bernstein; XSalsa uses longer nonces.<br><br><b>Key:</b> XSalsa20 uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> XSalsa20 uses a nonce of 24 bytes (192 bits).<br><br><b>Counter:</b> XSalsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.";
this.infoURL = "https://en.wikipedia.org/wiki/Salsa20#XSalsa20_with_192-bit_nonce";
this.inputType = "string";