A Python module for efficient calculation of Shannon byte entropy based on Rust.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for entropython-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 052e2bcae0602d13af1ab0fc674958152051144f8f59dea518f7eb085803fc50 |
|
MD5 | a089b1a33a4132ebb0436c895b9636fe |
|
BLAKE2b-256 | 8061495b6a26c507f5229d303ddd73f52f9a93be8fd2854862d804a72d007bb6 |
Close
Hashes for entropython-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b7ee13731f50d2b5957d1cd2348fc227482e2a238a3e40d07577fea6ea8c46d |
|
MD5 | 71b7bebb4d881fcde245ee4d6ed4b0c8 |
|
BLAKE2b-256 | a232af29c624eecf6dc712cd7a2b238b52805ebc0c7f5141eebe8adce56adc08 |
Close
Hashes for entropython-1.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 710f42a9b31dc7cd169b29d7486cc93155c210e30cba471826783eb4a397e14d |
|
MD5 | 487be180eab54ad59d0035538f8bf85e |
|
BLAKE2b-256 | 8c111e452460533937636075410c0e2dccb601a0b3e6b80e60d0586777dbc093 |
Close
Hashes for entropython-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 688f333a0d33f64b209bf9ed0fa4b5e71b588b7be5b3ac32b1394cc193b5bb2a |
|
MD5 | 355c0d64647dbc486b25e982025d4a37 |
|
BLAKE2b-256 | 55e6aab6673ec8a452bf5910d885fc4ed58ceedf2aa391521d08a79cd3871476 |
Close
Hashes for entropython-1.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e6fa39f09c59a0878cdb7f949e42e3d2bb5a333435c3b7eed88957105956102 |
|
MD5 | c258c1d2872af2edcad1518fc903fb8f |
|
BLAKE2b-256 | c505f68ee51f49bacce87d1dcbc9c75f14dd10b158cffa60eadb899b36a6fbd7 |