Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding negative numbers makes the program stall #6

Open
jw2476 opened this issue Apr 5, 2020 · 1 comment
Open

Encoding negative numbers makes the program stall #6

jw2476 opened this issue Apr 5, 2020 · 1 comment

Comments

@jw2476
Copy link

jw2476 commented Apr 5, 2020

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

@w1nte
Copy link

w1nte commented Jul 25, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants