MCPcopy Create free account
hub / github.com/argotorg/solidity / lebEncode

Function lebEncode

libsolutil/LEB128.h:26–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24{
25
26inline bytes lebEncode(uint64_t _n)
27{
28 bytes encoded;
29 while (_n > 0x7f)
30 {
31 encoded.emplace_back(uint8_t(0x80 | (_n & 0x7f)));
32 _n >>= 7;
33 }
34 encoded.emplace_back(_n);
35 return encoded;
36}
37
38// signed right shift is an arithmetic right shift
39static_assert((-1 >> 1) == -1, "Arithmetic shift not supported.");

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected