python-varint icon indicating copy to clipboard operation
python-varint copied to clipboard

Encoding negative numbers makes the program stall

Open jw2476 opened this issue 5 years ago • 1 comments

Using varint.encode(-1) makes the program indefinitely stall. Is this expected behaviour, because I really need to be able to write negative varints.

jw2476 avatar Apr 05 '20 17:04 jw2476

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.

w1nte avatar Jul 25 '20 16:07 w1nte