MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / MakeValue

Function MakeValue

src/test/fuzz/dbwrapper.cpp:111–116  ·  view source on GitHub ↗

Generate a deterministic value from key and size. The fuzz input picks * a 16-bit length (up to MAX_VALUE_LEN) and an 8-bit multiplier so that a * small amount of fuzz input can produce a wide range of value sizes. */

Source from the content-addressed store, hash-verified

109 * a 16-bit length (up to MAX_VALUE_LEN) and an 8-bit multiplier so that a
110 * small amount of fuzz input can produce a wide range of value sizes. */
111std::vector<uint8_t> MakeValue(uint16_t key, uint32_t size)
112{
113 std::vector<uint8_t> v(size);
114 std::iota(v.begin(), v.end(), static_cast<uint8_t>(key ^ (key >> 8)));
115 return v;
116}
117
118/** Equivalent to leveldb::BytewiseComparator() on 2-byte little-endian
119 * serialized uint16_t keys, while keeping the oracle keyed by uint16_t. */

Callers 3

VerifyIteratorFunction · 0.85
TestDbWrapperFunction · 0.85
dbwrapper.cppFile · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected