Browse Source

Fixed minor errors

bwhitn 7 years ago
parent
commit
4ca2a30249
2 changed files with 4 additions and 4 deletions
  1. 2 2
      src/core/config/OperationConfig.js
  2. 2 2
      src/core/operations/Entropy.js

+ 2 - 2
src/core/config/OperationConfig.js

@@ -3190,9 +3190,9 @@ const OperationConfig = {
         module: "Default",
         description: "Calculates the Chi Square distribution of values.",
         inputType: "byteArray",
-        outputType: "",
+        outputType: "number",
         args: []
-    }
+    },
     "Numberwang": {
         module: "Default",
         description: "Based on the popular gameshow by Mitchell and Webb.",

+ 2 - 2
src/core/operations/Entropy.js

@@ -176,7 +176,7 @@ const Entropy = {
         let distArray = new Array(256).fill(0),
             total = 0;
         for (let i = 0; i < input.length; i++) {
-            distArray[data[i]]++;
+            distArray[input[i]]++;
         }
         for (let i = 0; i < distArray.length; i++) {
             if (distArray[i] > 0) {
@@ -184,7 +184,7 @@ const Entropy = {
             }
         }
         return total;
-    }
+    },
 };
 
 export default Entropy;