Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
i2p Namespace Reference

Namespaces

namespace  sam

Classes

struct  Connection
 An established connection with another peer. More...

Typedefs

using Binary = std::vector<uint8_t>
 Binary data.

Functions

static std::string SwapBase64 (const std::string &from)
 Swap Standard Base64 <-> I2P Base64.
static Binary DecodeI2PBase64 (const std::string &i2p_b64)
 Decode an I2P-style Base64 string.
static CNetAddr DestBinToAddr (const Binary &dest)
 Derive the .b32.i2p address of an I2P destination (binary).
static CNetAddr DestB64ToAddr (const std::string &dest)
 Derive the .b32.i2p address of an I2P destination (I2P-style Base64).

Typedef Documentation

◆ Binary

using i2p::Binary = std::vector<uint8_t>

Binary data.

Definition at line 27 of file i2p.h.

Function Documentation

◆ DecodeI2PBase64()

Binary i2p::DecodeI2PBase64 ( const std::string & i2p_b64)
static

Decode an I2P-style Base64 string.

Parameters
[in]i2p_b64I2P-style Base64 string.
Returns
decoded i2p_b64
Exceptions
std::runtime_errorif decoding fails

Definition at line 74 of file i2p.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DestB64ToAddr()

CNetAddr i2p::DestB64ToAddr ( const std::string & dest)
static

Derive the .b32.i2p address of an I2P destination (I2P-style Base64).

Parameters
[in]destI2P destination.
Returns
the address that corresponds to dest
Exceptions
std::runtime_errorif conversion fails

Definition at line 112 of file i2p.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DestBinToAddr()

CNetAddr i2p::DestBinToAddr ( const Binary & dest)
static

Derive the .b32.i2p address of an I2P destination (binary).

Parameters
[in]destI2P destination.
Returns
the address that corresponds to dest
Exceptions
std::runtime_errorif conversion fails

Definition at line 90 of file i2p.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SwapBase64()

std::string i2p::SwapBase64 ( const std::string & from)
static

Swap Standard Base64 <-> I2P Base64.

Standard Base64 uses + and / as last two characters of its alphabet. I2P Base64 uses - and ~ respectively. So it is easy to detect in which one is the input and convert to the other.

Parameters
[in]fromInput to convert.
Returns
converted from

Definition at line 42 of file i2p.cpp.

Here is the caller graph for this function: