* 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 */
| 67 | * @throw std::runtime_error if decoding fails |
| 68 | */ |
| 69 | static Binary DecodeI2PBase64(const std::string& i2p_b64) |
| 70 | { |
| 71 | const std::string& std_b64 = SwapBase64(i2p_b64); |
| 72 | bool invalid; |
| 73 | Binary decoded = DecodeBase64(std_b64.c_str(), &invalid); |
| 74 | if (invalid) { |
| 75 | throw std::runtime_error(strprintf("Cannot decode Base64: \"%s\"", i2p_b64)); |
| 76 | } |
| 77 | return decoded; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Derive the .b32.i2p address of an I2P destination (binary). |
no test coverage detected