#include <peer_id.h>
|
| static constexpr size_t | kSize = 32 |
| | SHA-256 digest length.
|
Definition at line 27 of file peer_id.h.
◆ PeerId()
| librats::PeerId::PeerId |
( |
| ) |
|
|
default |
◆ bytes()
| const std::array< uint8_t, kSize > & librats::PeerId::bytes |
( |
| ) |
const |
|
inlinenoexcept |
◆ from_bytes()
Wrap raw 32 id-bytes verbatim (NOT hashed). nullopt unless exactly kSize.
◆ from_hex()
| std::optional< PeerId > librats::PeerId::from_hex |
( |
std::string_view | hex | ) |
|
|
static |
Parse a 64-char lowercase/uppercase hex string. nullopt if malformed.
◆ from_public_key() [1/2]
◆ from_public_key() [2/2]
| PeerId librats::PeerId::from_public_key |
( |
const uint8_t * | key, |
|
|
size_t | len ) |
|
static |
Derive the PeerId from a raw static public key (SHA-256 of the key).
References PeerId().
◆ is_zero()
| bool librats::PeerId::is_zero |
( |
| ) |
const |
|
noexcept |
◆ operator!=()
| bool librats::PeerId::operator!= |
( |
const PeerId & | o | ) |
const |
|
inlinenoexcept |
◆ operator<()
| bool librats::PeerId::operator< |
( |
const PeerId & | o | ) |
const |
|
inlinenoexcept |
◆ operator==()
| bool librats::PeerId::operator== |
( |
const PeerId & | o | ) |
const |
|
inlinenoexcept |
◆ short_hex()
| std::string librats::PeerId::short_hex |
( |
| ) |
const |
first 8 hex chars, for logs
◆ to_hex()
| std::string librats::PeerId::to_hex |
( |
| ) |
const |
◆ kSize
| size_t librats::PeerId::kSize = 32 |
|
staticconstexpr |
SHA-256 digest length.
Definition at line 29 of file peer_id.h.
The documentation for this class was generated from the following file: