Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.12 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.12 KB

cpp-varint

Build Status Build Status Coverage Status

A varint implementation in modern C++, providing codecs for encoding and decoding, and an integer-like value type.

Installation

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

Usage

// 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);

License

varint is released under the MIT License.