Skip to main content

empirical_entropy_bytes

Function empirical_entropy_bytes 

Source
pub fn empirical_entropy_bytes(data: &[u8]) -> f64
Expand description

Empirical (zero-order, IID) Shannon entropy H₀(X) in bits/symbol.

Treats the input as a sequence of IID byte symbols and returns the plug-in Shannon entropy of the observed byte frequencies. Use a context-aware crate::api::RateBackend via try_entropy_rate_bytes for higher-order estimation.