A library for encoding and decoding integers using modular arithmetic
Project description
int_encoder
int_encoder is a Python library for encoding and decoding integers using modular arithmetic.
Installation
To install the library from PyPI, simply run:
pip3 install int-encoder
Configuration
The library uses two configuration constants, defined in config.py:
INT_ENCODE_KEY: The key used for encoding and decoding integers.INT_ENCODED_MAX: The maximum value for the encoded integer.
These values can be modified in config.py to suit your needs.
Usage
import int_encoder
# Modify configuration constants (optional)
int_encoder.config.INT_ENCODE_KEY = 987654321 # New key for encoding
int_encoder.config.INT_ENCODED_MAX = 2 ** 16 # New maximum value for encoded integers
# Example usage
int_to_encode = 123456
encoded_value = int_encoder.encode(int_to_encode)
print(f"Encoded value: {encoded_value}")
decoded_value = int_encoder.decode(encoded_value)
print(f"Decoded value: {decoded_value}")
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file int_encoder-1.0.1.tar.gz.
File metadata
- Download URL: int_encoder-1.0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3d03764a312c094ee72e728868f4c0111dc8c199f86f5faa7193e5ea18e803c
|
|
| MD5 |
bb2d96dbbb458488534b4ea463a8d9ab
|
|
| BLAKE2b-256 |
0a5bc004128aff10ebcc0374a7faf7120fd7de5837f299a22fc0ff60f471785b
|
File details
Details for the file int_encoder-1.0.1-py3-none-any.whl.
File metadata
- Download URL: int_encoder-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a77ca1358074a1071b179311063efc8c4e7c7a13ed42dc116071babbe9f5bc6e
|
|
| MD5 |
caed33e2ecb32570335994cf3f647ec9
|
|
| BLAKE2b-256 |
85fe029b0e5c0ad9963cd8e31489ea29f77bd4b8e72543597bde2a8b6f1f3514
|