Varints, a method of serializing integers using one or more bytes
|
||
---|---|---|
pyvarint | ||
test | ||
.drone.yml | ||
.gitignore | ||
CHANGELOG.md | ||
LICENSE | ||
pyproject.toml | ||
README.md |
pyvarint
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