Bitcoin Core  27.99.0
P2P Digital Currency
Namespaces | Classes | Typedefs | Functions
i2p Namespace Reference

Namespaces

 sam
 

Classes

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

Typedefs

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

Functions

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

Typedef Documentation

◆ Binary

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

Binary data.

Definition at line 27 of file i2p.h.

Function Documentation

◆ DecodeI2PBase64()

static 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 71 of file i2p.cpp.

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

◆ DestB64ToAddr()

static 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 109 of file i2p.cpp.

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

◆ DestBinToAddr()

static 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 87 of file i2p.cpp.

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

◆ SwapBase64()

static 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 39 of file i2p.cpp.

Here is the caller graph for this function: