entropython-1.0.2
توضیحات
A Python module for efficient calculation of Shannon byte entropy based on Rust.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | entropython-1.0.2 |
| نام | entropython |
| نسخه کتابخانه | 1.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Enkelmann <nils-edvin.enkelmann@fkie.fraunhofer.de> |
| ایمیل نویسنده | Enkelmann <nils-edvin.enkelmann@fkie.fraunhofer.de> |
| آدرس صفحه اصلی | https://github.com/fkie-cad/entropython |
| آدرس اینترنتی | https://pypi.org/project/entropython/ |
| مجوز | MIT |
# entropython
A Python module for efficient calculation of Shannon byte entropy based on Rust.
## Installation
Just run
```shell
pip install entropython
```
## Usage
```python
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](https://www.rust-lang.org/) needs to be installed.
Run
```shell
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.
نحوه نصب
نصب پکیج whl entropython-1.0.2:
pip install entropython-1.0.2.whl
نصب پکیج tar.gz entropython-1.0.2:
pip install entropython-1.0.2.tar.gz