MCPcopy Create free account
hub / github.com/bcndev/bytecoin / interactive_test

Function interactive_test

src/common/Base58.cpp:260–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260void interactive_test() {
261 std::cout << "interactive_test" << std::endl;
262 BinaryArray addr_data;
263 common::from_hex("cef5f4bdd171", &addr_data);
264 BinaryArray zeroes(16);
265 uint64_t tag = 0;
266 common::read_varint(addr_data.begin(), addr_data.end(), &tag);
267 std::cout << "tag=" << tag << std::endl;
268 while (true) {
269 std::cout << common::to_hex(addr_data) << std::endl;
270 for (size_t i = 0; i != 256; ++i) {
271 BinaryArray ba = addr_data;
272 ba.push_back(i);
273 append(ba, zeroes.begin(), zeroes.end());
274 std::string str = encode(ba);
275 std::cout << str << " " << i << std::endl;
276 }
277 int c = 0;
278 std::cin >> c;
279 if (c == -1) {
280 if (!addr_data.empty())
281 addr_data.pop_back();
282 continue;
283 }
284 addr_data.push_back(c);
285 }
286}
287
288}} // namespace common::base58

Callers

nothing calls this directly

Calls 8

from_hexFunction · 0.85
appendFunction · 0.85
read_varintFunction · 0.70
to_hexFunction · 0.70
encodeFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected