Crate bitcoin_sam

source ·

Structs

Constants

  • | The maximum size of an incoming message | from the I2P SAM proxy (in bytes). | | Used to avoid a runaway proxy from sending | us an “unlimited” amount of data without | a terminator. | | The longest known message is ~1400 bytes, | so this is high enough not to be triggered | during normal operation, yet low enough | to avoid a malicious proxy from filling | our memory. |

Traits

  • | Generic interface for managing an event | handler or callback function registered with | another interface. Has a single disconnect | method to cancel the registration and prevent | any future notifications.

Functions

  • | 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 |
  • | Derive the .b32.i2p address of an I2P | destination (I2P-style Base64). | | ———– | @param[in] dest | | I2P destination. | | ———– | @return | | the address that corresponds to dest | @throw std::runtime_error if conversion | fails |
  • | Derive the .b32.i2p address of an I2P | destination (binary). | | ———– | @param[in] dest | | I2P destination. | | ———– | @return | | the address that corresponds to dest | @throw std::runtime_error if conversion | fails |
  • | 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. | | ———– | @param[in] from | | Input to convert. | | ———– | @return | | converted from |

Type Definitions