koinos / koinos-types

The Rosetta Stone of the Koinos ecosystem. Allows for the interpretation of Koinos data structures in a multitude of languages. Useful in the development of microservices, clients, and smart contracts.
MIT License
12 stars 3 forks source link

Canonical variable integer #79

Closed theoreticalbts closed 3 years ago

theoreticalbts commented 3 years ago

Varint encoding allows some variable integers to be "spelled" multiple ways. For example zero can be \x00 (the shortest and most obvious encoding), but it can also be encoded as \x80\x00.

This ticket can be resolved by disallowing the latter encoding for all languages, and adding unit tests to verify it is enforced.