* Decode an I2P-style Base64 string. * @param[in] i2p_b64 I2P-style Base64 string. * @return decoded `i2p_b64` * @throw std::runtime_error if decoding fails */
| 72 | * @throw std::runtime_error if decoding fails |
| 73 | */ |
| 74 | static Binary DecodeI2PBase64(const std::string& i2p_b64) |
| 75 | { |
| 76 | const std::string& std_b64 = SwapBase64(i2p_b64); |
| 77 | auto decoded = DecodeBase64(std_b64); |
| 78 | if (!decoded) { |
| 79 | throw std::runtime_error(strprintf("Cannot decode Base64: \"%s\"", i2p_b64)); |
| 80 | } |
| 81 | return std::move(*decoded); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Derive the .b32.i2p address of an I2P destination (binary). |
no test coverage detected