Varints, a method of serializing integers using one or more bytes
Go to file
2020-07-07 16:00:50 +02:00
pyvarint Migrate to pyproject config 2020-07-07 15:59:42 +02:00
test Migrate to pyproject config 2020-07-07 15:59:42 +02:00
.drone.yml Bootstrap pyvarint package 2020-06-26 17:19:34 +02:00
.gitignore Bootstrap pyvarint package 2020-06-26 17:19:34 +02:00
CHANGELOG.md Migrate to pyproject config 2020-07-07 15:59:42 +02:00
LICENSE Bootstrap pyvarint package 2020-06-26 17:19:34 +02:00
poetry.lock Add missing poetry lock file 2020-07-07 16:00:50 +02:00
pyproject.toml Migrate to pyproject config 2020-07-07 15:59:42 +02:00
README.md Migrate to pyproject config 2020-07-07 15:59:42 +02:00

pyvarint

Build Status

Varints, a method of serializing integers using one or more bytes

Install

$ pip install pyvarint

Example

from random import sample
from pyvarint import decode, encode

ten_rand_ints = sample(range(100), 10)

for rand_int in ten_rand_ints:
    encoded = encode(rand_int)
    decoded = decode(encoded)
    assert decoded == rand_int