A varint implementation in modern C++, providing codecs for encoding and decoding, and an integer-like value type.
varint is available as a vcpkg port via the cpp-ipfs fork.
> git clone https://github.com/cpp-ipfs/vcpkg
> cd vcpkg
PS> .\bootstrap-vcpkg.bat
Linux:~/$ ./bootstrap-vcpkg.sh
PS> .\vcpkg install varint
Linux:~/$ ./vcpkg install varint
// create a varint
auto vi = varint::uleb128<std::array<char,2>>{};
// assign an integer value
vi = 1233u;
// convert back into an integer
auto i = static_cast<unsigned int>(vi);
varint is released under the MIT License.