mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
Fixed tests for octal operations.
This commit is contained in:
parent
a36c9ca339
commit
5f85bff315
5 changed files with 88 additions and 7 deletions
|
@ -56,7 +56,7 @@ const ByteRepr = {
|
|||
|
||||
|
||||
/**
|
||||
* To Oct operation.
|
||||
* To Octal operation.
|
||||
*
|
||||
* @author Matt C [matt@artemisbot.pw]
|
||||
* @param {byteArray} input
|
||||
|
@ -65,11 +65,12 @@ const ByteRepr = {
|
|||
*/
|
||||
runToOct: function(input, args) {
|
||||
var delim = Utils.charRep[args[0] || "Space"];
|
||||
return input.map(val => parseInt(Utils.bin(val), 2).toString(8)).join(delim);
|
||||
return input.map(val => val.toString(8)).join(delim);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* From Oct operation.
|
||||
* From Octal operation.
|
||||
*
|
||||
* @author Matt C [matt@artemisbot.pw]
|
||||
* @param {string} input
|
||||
|
@ -82,6 +83,7 @@ const ByteRepr = {
|
|||
return input.split(delim).map(val => parseInt(val, 8));
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @constant
|
||||
* @default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue