| 13 | |
| 14 | |
| 15 | static void Bech32Encode(benchmark::State& state) |
| 16 | { |
| 17 | std::vector<uint8_t> v = ParseHex("c97f5a67ec381b760aeaf67573bc164845ff39a3bb26a1cee401ac67243b48db"); |
| 18 | std::vector<unsigned char> tmp = {0}; |
| 19 | tmp.reserve(1 + 32 * 8 / 5); |
| 20 | ConvertBits<8, 5, true>([&](unsigned char c) { tmp.push_back(c); }, v.begin(), v.end()); |
| 21 | while (state.KeepRunning()) { |
| 22 | bech32::Encode("btg", tmp); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | |
| 27 | static void Bech32Decode(benchmark::State& state) |