mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Adds Octal functions
- To Octal - From Octal
This commit is contained in:
parent
94ea086e05
commit
b8ce10ae96
4 changed files with 96 additions and 1 deletions
|
@ -21,6 +21,11 @@ var ByteRepr = {
|
|||
* @default
|
||||
*/
|
||||
HEX_DELIM_OPTIONS: ["Space", "Comma", "Semi-colon", "Colon", "Line feed", "CRLF", "0x", "\\x", "None"],
|
||||
/**
|
||||
* @constant
|
||||
* @default
|
||||
*/
|
||||
OCT_DELIM_OPTIONS: ["Space", "Comma", "Semi-colon", "Colon", "Line feed", "CRLF"],
|
||||
/**
|
||||
* @constant
|
||||
* @default
|
||||
|
@ -53,6 +58,32 @@ var ByteRepr = {
|
|||
},
|
||||
|
||||
|
||||
/**
|
||||
* To Oct operation.
|
||||
*
|
||||
* @author Matt C [matt@artemisbot.pw]
|
||||
* @param {byteArray} input
|
||||
* @param {Object[]} args
|
||||
* @returns {string}
|
||||
*/
|
||||
runToOct: function(input, args) {
|
||||
var delim = Utils.charRep[args[0] || "Space"];
|
||||
return Utils.toOct(input, delim, 2);
|
||||
},
|
||||
|
||||
/**
|
||||
* From Oct operation.
|
||||
*
|
||||
* @author Matt C [matt@artemisbot.pw]
|
||||
* @param {string} input
|
||||
* @param {Object[]} args
|
||||
* @returns {byteArray}
|
||||
*/
|
||||
runFromOct: function(input, args) {
|
||||
var delim = Utils.charRep[args[0] || "Space"];
|
||||
return Utils.fromOct(input, delim);
|
||||
},
|
||||
|
||||
/**
|
||||
* @constant
|
||||
* @default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue