varints
Variable-length integer (VLQ) encoding and decoding in C99
varints.h
Go to the documentation of this file.
1
20#ifndef VARINTS_H
21#define VARINTS_H
22
23
27#define VARINTS_MAX_ENCODED_LEN (10u)
28
29
42int varint_encode_u64(uint64_t input, uint8_t *output, int *bytes_generated);
43
44
58int varint_decode_u64(uint8_t *input, uint64_t *output, int *bytes_consumed);
59
60
73int varint_encode_i64(int64_t input, uint8_t *output, int *bytes_generated);
74
75
89int varint_decode_i64(uint8_t *input, int64_t *output, int *bytes_consumed);
90
91#endif // VARINTS_H
int varint_decode_u64(uint8_t *input, uint64_t *output, int *bytes_consumed)
int varint_encode_i64(int64_t input, uint8_t *output, int *bytes_generated)
int varint_encode_u64(uint64_t input, uint8_t *output, int *bytes_generated)
int varint_decode_i64(uint8_t *input, int64_t *output, int *bytes_consumed)