pawitp / protobuf-decoder

JavaScript-based web UI to decode ad-hoc Protobuf data
https://protobuf-decoder.netlify.app/
MIT License
392 stars 91 forks source link

[Improvement idea 💡] Add support for sint32 / sint64 #36

Closed obrassard closed 3 years ago

obrassard commented 3 years ago

Hello ! First of all, I find your project very nice and useful in educational situations!

I have a suggestion for improvement that would be useful and interesting to add. Indeed, I think it could be great, for varint variables, to display the equivalent negative value when decoding. For instance, if we have a variable of type sint32 or sint64, the value 9f a3 64 is -821456 but with standard integers, it would be 1642911.

The decoded result could present various possible values depending of the original datatype like :

int32 => 1642911 sint32 => -821456