A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sorribas/varint.c below:

GitHub - sorribas/varint.c: Varint C library.

Static C library to use protobuf-style varint.

char* varint_encode(unsigned long long n, char* buf, int len, unsigned char* bytes)

Encodes a unsigned long long number into varint and stores the result in the char array passed the buf parameter. If you want to know how many bytes the encoded number takes, you cans pass the bytes parameter and the amount of bytes will be stored there.

unsigned long long varint_decode(char buf*, int len, unsigned char* bytes);

Decodes a varint passed as a char array and returns it as a unsigned long long integer. If you want to know how many bytes the decoder when through, pass a the bytes argument and it will be stored there.

int varint_encoding_length(unsigned long long number);

Returns the length of the varint buffer to encode this number.

Just run

and you should get a static library in varint.a.

If you want to compile the example you can do

gcc example.c varint.a -o example

and run it with

You can also install using clibs

clib install sorribas/varint.c

MIT


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4