Crates.io | approx_shannon_entropy |
lib.rs | approx_shannon_entropy |
version | 0.1.1 |
source | src |
created_at | 2021-04-17 02:05:33.202709 |
updated_at | 2021-04-18 21:01:24.015195 |
description | Approximate Shannon entropy, using micromath natural logarithm |
homepage | |
repository | https://github.com/hazelutf8/approx_shannon_entropy |
max_upload_size | |
id | 385572 |
size | 9,357 |
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.
Add this to your Cargo.toml
[dependencies]
approx_shannon_entropy = "0.1.1"
$ cargo run --example three_bits
Shannon Entropy (approximate bits per byte): 1
$ cargo build --example stdin_entropy
$ echo A | ./target/debug/examples/stdin_entropy