MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / EncodeVarint

Function EncodeVarint

src/common/protobuf.cpp:16–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16size_t EncodeVarint(uint8_t* buf, uint64_t value) {
17 size_t i = 0;
18 do {
19 buf[i] = value & 0x7F;
20 value >>= 7;
21 if (value) buf[i] |= 0x80;
22 ++i;
23 } while (value);
24 return i;
25}
26
27std::vector<Field> Parse(const uint8_t* buf, size_t bufLen) {
28 std::vector<Field> fields;

Callers 1

WriteRawVarintMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected