mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -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
|
@ -212,7 +212,7 @@ const Utils = {
|
|||
* @returns {string}
|
||||
*/
|
||||
printable: function(str, preserveWs) {
|
||||
if (window && window.app && !window.app.options.treatAsUtf8) {
|
||||
if (typeof window !== "undefined" && window.app && !window.app.options.treatAsUtf8) {
|
||||
str = Utils.byteArrayToChars(Utils.strToByteArray(str));
|
||||
}
|
||||
|
||||
|
@ -388,8 +388,9 @@ const Utils = {
|
|||
var wordArray = CryptoJS.enc.Utf8.parse(str),
|
||||
byteArray = Utils.wordArrayToByteArray(wordArray);
|
||||
|
||||
if (window && str.length !== wordArray.sigBytes)
|
||||
if (typeof window !== "undefined" && str.length !== wordArray.sigBytes) {
|
||||
window.app.options.attemptHighlight = false;
|
||||
}
|
||||
return byteArray;
|
||||
},
|
||||
|
||||
|
@ -440,7 +441,7 @@ const Utils = {
|
|||
var wordArray = new CryptoJS.lib.WordArray.init(words, byteArray.length),
|
||||
str = CryptoJS.enc.Utf8.stringify(wordArray);
|
||||
|
||||
if (window && str.length !== wordArray.sigBytes)
|
||||
if (typeof window !== "undefined" && str.length !== wordArray.sigBytes)
|
||||
window.app.options.attemptHighlight = false;
|
||||
return str;
|
||||
} catch (err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue