MCPcopy Create free account
hub / github.com/ElementsProject/elements / FromBytes

Function FromBytes

src/test/addrman_tests.cpp:49–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48
49static std::vector<bool> FromBytes(const unsigned char* source, int vector_size)
50{
51 std::vector<bool> result(vector_size);
52 for (int byte_i = 0; byte_i < vector_size / 8; ++byte_i) {
53 unsigned char cur_byte = source[byte_i];
54 for (int bit_i = 0; bit_i < 8; ++bit_i) {
55 result[byte_i * 8 + bit_i] = (cur_byte >> bit_i) & 1;
56 }
57 }
58 return result;
59}
60
61BOOST_FIXTURE_TEST_SUITE(addrman_tests, BasicTestingSetup)
62

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected