2
0
mirror of https://github.com/gchq/CyberChef synced 2025-12-05 23:53:27 +00:00

Made fixes so that tests might work

This commit is contained in:
Matt C
2017-03-28 16:21:57 +00:00
parent 96e40a6479
commit 7ab6c88774

View File

@@ -62,10 +62,8 @@ var ByteRepr = {
* @returns {string}
*/
runToOct: function(input, args) {
var delim = Utils.charRep[args[0] || "Space"],
output = "";
input.map(val => output += (parseInt(Utils.bin(val), 2).toString(8) + delim));
return output.slice(0, -delim.length);
var delim = Utils.charRep[args[0] || "Space"];
return input.map(val => parseInt(Utils.bin(val), 2).toString(8)).join(delim);
},
/**
@@ -78,6 +76,7 @@ var ByteRepr = {
*/
runFromOct: function(input, args) {
var delim = Utils.charRep[args[0] || "Space"];
if (input.length === 0) return [];
return input.split(delim).map(val => parseInt(val, 8));
},