ent-rs 0.1.1

Entropy and randomness analysis tool for binary files (Rust port of ent.hpp)
Documentation
  • Coverage
  • 100%
    12 out of 12 items documented1 out of 3 items with examples
  • Size
  • Source code size: 21.06 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.97 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 9s Average build duration of successful builds.
  • all releases: 1m 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • chbtoys/ent-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • chbtoys

crates.io docs.rs CI

ent-rs

ent-rs is a Rust library for analyzing the entropy and randomness characteristics of binary data. It is a Rust port and extension of the functionality from Håkan Blomqvist's ent.hpp.

It is useful for evaluating:

  • Compression potential
  • Statistical randomness
  • Distribution uniformity
  • Pseudorandom number generators
  • Data quality or obfuscation

Features

  • Byte and bit mode entropy analysis
  • Chi-square test and p-value
  • Arithmetic mean
  • Monte Carlo Pi estimation
  • Serial correlation
  • Value frequency tables

Usage

Add to your Cargo.toml:

ent-rs = "0.1"

Example

use ent_rs::EntStats;
let data = std::fs::read("mydata.bin").unwrap();
let stats = EntStats::from_data(&data, false);
println!("Entropy: {:.4}", stats.entropy);