python-varint
python-varint copied to clipboard
Encoding negative numbers makes the program stall
Using varint.encode(-1) makes the program indefinitely stall. Is this expected behaviour, because I really need to be able to write negative varints.
I faced the same problem. According to the wikipedia article about Variable-length quanitity only unsigned integers are defined in the basic implementation. So you need another variant of varint like ZigZag encoding.