diff --git a/src/core/Utils.mjs b/src/core/Utils.mjs index 65ed07fb..ec93cdc4 100755 --- a/src/core/Utils.mjs +++ b/src/core/Utils.mjs @@ -333,7 +333,7 @@ class Utils { * Accepts hex, Base64, UTF8 and Latin1 strings. * * @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} * * @example @@ -350,6 +350,8 @@ class Utils { switch (type.toLowerCase()) { case "hex": return Utils.byteArrayToChars(fromHex(str)); + case "decimal": + return Utils.byteArrayToChars(fromDecimal(str)); case "base64": return Utils.byteArrayToChars(fromBase64(str, null, "byteArray")); case "utf8": diff --git a/src/core/operations/ChangeIPFormat.mjs b/src/core/operations/ChangeIPFormat.mjs index b985312a..56c5ffe1 100644 --- a/src/core/operations/ChangeIPFormat.mjs +++ b/src/core/operations/ChangeIPFormat.mjs @@ -21,7 +21,7 @@ class ChangeIPFormat extends Operation { super(); this.name = "Change IP format"; - this.module = "JSBN"; + this.module = "Default"; this.description = "Convert an IP address from one format to another, e.g. 172.20.23.54 to ac141736"; this.inputType = "string"; this.outputType = "string"; @@ -29,12 +29,12 @@ class ChangeIPFormat extends Operation { { "name": "Input format", "type": "option", - "value": ["Hex", "Raw"] + "value": ["Dotted Decimal", "Decimal", "Hex"] }, { "name": "Output format", "type": "option", - "value": ["Hex", "Raw"] + "value": ["Dotted Decimal", "Decimal", "Hex"] } ]; }