Skip to main content

A Python library for pure Python encoding and decoding of integers using Variable-length quantity.

Project description

pyvlq

pyvlq is a Python library for encoding and decoding Variable-Length Quantity <https://en.wikipedia.org/wiki/Variable-length_quantity>_.

The library is available on PyPI and can be installed using pip:

pip install pyvlq

Usage

from io import BytesIO
import pyvlq

# Encode
encoded = pyvlq.encode(128)
print(encoded) # b'\x81\x00'

# Decode
decoded = pyvlq.decode(encoded)
print(decoded) # 128

# Decode from readable bytes
buffer = BytesIO(b'\x81\x00\xff\xff')
decoded = pyvlq.decode_stream(buffer)
print(decoded) # 128 (0xff\xff is ignored)
print(buffer.read(2)) # b'\xff\xff' (0xff\xff is left in the buffer)

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

pyvlq-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvlq-0.1.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file pyvlq-0.1.1.tar.gz.

File metadata

  • Download URL: pyvlq-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.13

File hashes

Hashes for pyvlq-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f1d8c7d8b07f1a7de83f70793e33f0cbceb345262e98809d8fc526ad37870aa5
MD5 1a28e82b555a3c44e351089809c10e1a
BLAKE2b-256 99a86c55fe83f0ada0937840de122158327e05282f1243cee9f89aa7302de430

See more details on using hashes here.

File details

Details for the file pyvlq-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyvlq-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.13

File hashes

Hashes for pyvlq-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da248d8484b86cab77c4ceabfadea70704e9530b651d88c94c12acdf5d55861c
MD5 e6c3ce29f4e2db9443a33b8c65fdde53
BLAKE2b-256 aa418e5971ebd3c22d452e9d9e572b76e1db8b79a17bdfefc09905888cf6f62a

See more details on using hashes here.

Supported by

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