MCPcopy Create free account
hub / github.com/chen3feng/toft / UnsafeEncode64

Method UnsafeEncode64

encoding/varint.cpp:50–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50char* Varint::UnsafeEncode64(char* dst, uint64_t v) {
51 unsigned char* ptr = reinterpret_cast<unsigned char*>(dst);
52 while (v >= static_cast<uint64_t>(kIncompleteMask)) {
53 *(ptr++) = (v & (kIncompleteMask - 1)) | kIncompleteMask;
54 v >>= 7;
55 }
56 *(ptr++) = static_cast<unsigned char>(v);
57 return reinterpret_cast<char*>(ptr);
58}
59
60void Varint::Put64(std::string* dst, uint64_t v) {
61 char buf[10];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected