We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
index out of bounds: the len is 266 but the index is 266
1 parent f0f99d4 commit 052601bCopy full SHA for 052601b
1 file changed
src/utils.rs
@@ -44,7 +44,7 @@ pub fn calculate_entropy(data: &[u8]) -> f64 {
44
for &count in byte_counts.iter().filter(|&&c| c > 0) {
45
let probability = count as f64 / len;
46
47
- if count < 267 {
+ if count < 266 {
48
entropy -= probability * LOG2_TABLE[count as usize];
49
} else {
50
entropy -= probability * (probability.ln() / std::f64::consts::LN_2);
0 commit comments