mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
ESM: Ported BSON, ToTable, Filetime and XKCD operations
This commit is contained in:
parent
eed28f67d5
commit
749b0510e7
7 changed files with 483 additions and 2 deletions
40
src/core/operations/XKCDRandomNumber.mjs
Normal file
40
src/core/operations/XKCDRandomNumber.mjs
Normal file
|
@ -0,0 +1,40 @@
|
|||
/**
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import Operation from "../Operation";
|
||||
|
||||
/**
|
||||
* XKCD Random Number operation
|
||||
*/
|
||||
class XKCDRandomNumber extends Operation {
|
||||
|
||||
/**
|
||||
* XKCDRandomNumber constructor
|
||||
*/
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.name = "XKCD Random Number";
|
||||
this.module = "Default";
|
||||
this.description = "RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.<br><br><a href='https://xkcd.com/221/'>XKCD #221</a>";
|
||||
this.inputType = "string";
|
||||
this.outputType = "number";
|
||||
this.args = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} input
|
||||
* @param {Object[]} args
|
||||
* @returns {number}
|
||||
*/
|
||||
run(input, args) {
|
||||
return 4; // chosen by fair dice roll.
|
||||
// guaranteed to be random.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default XKCDRandomNumber;
|
Loading…
Add table
Add a link
Reference in a new issue