pyvarint/README.md

515 B

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