Skip to main content

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() and int.from_bytes();
    • Exposing the low level function ilint_decode_multibyte_core();
  • 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

pyilint-0.2.2.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

pyilint-0.2.2-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page