Function approx_shannon_entropy::shannon_entropy_metric[][src]

pub fn shannon_entropy_metric(word_slice: &[u8]) -> f32

Shannon metric entropy of a slice

Shannon metric entropy is the Shannon entropy value divided by the input slice length

Arguments

  • word_slice - Slice of bytes

Result

  • Returns - Shannon metric entropy fraction (normalized by length), inclusive range from 0 to 1
let zeros = [1u8; 35usize];
let found = shannon_entropy_metric(&zeros);