2 releases
0.1.1 | Apr 18, 2021 |
---|---|
0.1.0 | Apr 17, 2021 |
#1438 in Embedded development
9KB
113 lines
Approximate Shannon Entropy
A rust library to calculate the approximate Shannon entropy of a slice.
Usable on no_std due to use of approximate natural log from micromath.
Usage
Add this to your Cargo.toml
[dependencies]
approx_shannon_entropy = "0.1.1"
Examples
$ cargo run --example three_bits
Shannon Entropy (approximate bits per byte): 1
$ cargo build --example stdin_entropy
$ echo A | ./target/debug/examples/stdin_entropy
lib.rs
:
Approximate Shannon Entropy
Based on shannon-entropy
Usable on no_std due to use of approximate natural log from micromath
Dependencies
~220KB