Skip to content

fkie-cad/entropython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

entropython

A Python module for efficient calculation of Shannon byte entropy based on Rust.

Installation

Just run

pip install entropython

Usage

from entropython import shannon_entropy, metric_entropy

bytes = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.'.encode('utf-8')
print(shannon_entropy(bytes))
print(metric_entropy(bytes))

Build from Source

For building the binary from source, Rust needs to be installed.

Run

cargo build --release
mv target/release/libentropython.so entropython.so # The renaming is necessary for Python to find the module
# Optional: Remove debug symbols from the binary to dramatically reduce its size.
strip entropython.so

The built entropython.so itself has no dependencies.

About

Efficient calculation of shannon byte entropy based on rust library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages