mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
'Change IP format' operation now uses the correct arguments. Fixes #332
This commit is contained in:
parent
e11bb38625
commit
5bcdd99870
2 changed files with 6 additions and 4 deletions
|
@ -333,7 +333,7 @@ class Utils {
|
||||||
* Accepts hex, Base64, UTF8 and Latin1 strings.
|
* Accepts hex, Base64, UTF8 and Latin1 strings.
|
||||||
*
|
*
|
||||||
* @param {string} str
|
* @param {string} str
|
||||||
* @param {string} type - One of "Hex", "Base64", "UTF8" or "Latin1"
|
* @param {string} type - One of "Hex", "Decimal", "Base64", "UTF8" or "Latin1"
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
|
@ -350,6 +350,8 @@ class Utils {
|
||||||
switch (type.toLowerCase()) {
|
switch (type.toLowerCase()) {
|
||||||
case "hex":
|
case "hex":
|
||||||
return Utils.byteArrayToChars(fromHex(str));
|
return Utils.byteArrayToChars(fromHex(str));
|
||||||
|
case "decimal":
|
||||||
|
return Utils.byteArrayToChars(fromDecimal(str));
|
||||||
case "base64":
|
case "base64":
|
||||||
return Utils.byteArrayToChars(fromBase64(str, null, "byteArray"));
|
return Utils.byteArrayToChars(fromBase64(str, null, "byteArray"));
|
||||||
case "utf8":
|
case "utf8":
|
||||||
|
|
|
@ -21,7 +21,7 @@ class ChangeIPFormat extends Operation {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.name = "Change IP format";
|
this.name = "Change IP format";
|
||||||
this.module = "JSBN";
|
this.module = "Default";
|
||||||
this.description = "Convert an IP address from one format to another, e.g. <code>172.20.23.54</code> to <code>ac141736</code>";
|
this.description = "Convert an IP address from one format to another, e.g. <code>172.20.23.54</code> to <code>ac141736</code>";
|
||||||
this.inputType = "string";
|
this.inputType = "string";
|
||||||
this.outputType = "string";
|
this.outputType = "string";
|
||||||
|
@ -29,12 +29,12 @@ class ChangeIPFormat extends Operation {
|
||||||
{
|
{
|
||||||
"name": "Input format",
|
"name": "Input format",
|
||||||
"type": "option",
|
"type": "option",
|
||||||
"value": ["Hex", "Raw"]
|
"value": ["Dotted Decimal", "Decimal", "Hex"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Output format",
|
"name": "Output format",
|
||||||
"type": "option",
|
"type": "option",
|
||||||
"value": ["Hex", "Raw"]
|
"value": ["Dotted Decimal", "Decimal", "Hex"]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue