Pure Python implementation of InterlockLedger ILInt standard
Project description
PyILInt
Description
PyILInt is a pure Python implementation of the InterlockLedger ILInt integer encoding standard.
This implementation is based on the reference implementation shipped with the official definition of the standard and the rust-il2-ilint.
Requirements
This program was developed for Python 3.6 or higher. No external dependencies are required.
Installation
To install this library, you may download the code from
github and copy
the contents of the directory src
into your module's directory.
You can also use pip to install it by running the command:
$ pip install pyilint
How to use it
A simple example program is:
import random
from pyilint import MAX_UINT64, ilint_encode, ilint_decode
v = random.randrange(0, MAX_UINT64)
buff = bytearray()
size = ilint_encode(v, buff)
print(f'{v} was encoded to {buff} in {size} bytes...')
dec, dec_size = ilint_decode(buff)
print(f'...and was decoded to {dec} using {dec_size} bytes.')
The documentation of this library can be found in the source code and in its unit-tests.
License
This program is licensed under the BSD 3-Clause License.
Changes
- 0.2.2:
- Tested on multiple versions of python with tox;
- 0.2.1:
- Unit-tests removed from the distribution package;
- 0.2.0:
- Replacing bitwise operations by
int.to_bytes()
andint.from_bytes()
; - Exposing the low level function
ilint_decode_multibyte_core()
;
- Replacing bitwise operations by
- 0.1.1:
- Initial public release;
Project details
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
File details
Details for the file pyilint-0.2.2.tar.gz
.
File metadata
- Download URL: pyilint-0.2.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2338f19af0dae10f9ff1f9fb41859d1cf99c19a272654669fa51acbdf75f6358 |
|
MD5 | 4173564b6aa245036acd04843a4ecac2 |
|
BLAKE2b-256 | ec6a1cbb1f32fea789f73d24df604d9ab70a1c56b1de45223675c830e87a92e8 |
File details
Details for the file pyilint-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: pyilint-0.2.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4709198c668566523806264f2cfb9ea0d3986f70e6da78e4d2a835541a510275 |
|
MD5 | 7276786051fa2d97c88e126b4b039152 |
|
BLAKE2b-256 | f19405e23032a96d6afac192c7313ee070e1955a61fbcd07800eb3cc5973531f |