Skip to content

Commit

Permalink
Fixed minor errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitn committed Dec 18, 2017
1 parent 08a3152 commit 4ca2a30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/config/OperationConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
4 changes: 2 additions & 2 deletions src/core/operations/Entropy.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ 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) {
total += Math.pow(distArray[i] - input.length / 256, 2) / (input.length / 256);
}
}
return total;
}
},
};

export default Entropy;

0 comments on commit 4ca2a30

Please sign in to comment.