Offline Transaction Signing (OTS) 0.1.0
|
Secure container for seed word indices. More...
#include <ots.hpp>
Public Member Functions | |
SeedIndices () noexcept=default | |
Default constructor. | |
SeedIndices (const std::vector< uint16_t > &v) | |
Construct from std::vector. | |
SeedIndices (size_t size) | |
Construct with size. | |
SeedIndices (size_t size, uint16_t value) | |
Construct with size and value. | |
SeedIndices (const SeedIndices &other) | |
Copy constructor. | |
SeedIndices (SeedIndices &&other) noexcept | |
Move constructor. | |
SeedIndices & | operator= (const SeedIndices &other) |
Copy assignment operator. | |
SeedIndices & | operator= (SeedIndices &&other) noexcept |
Move assignment operator. | |
operator const uint8_t * () const noexcept | |
conversion to const uint8_t*, | |
operator const char * () const noexcept | |
conversion to const char*, | |
operator const std::vector< uint16_t > & () const noexcept | |
conversion to const std::vector<uint16_t>& | |
operator const std::string () const noexcept | |
Conversion to std::string. | |
bool | operator== (const SeedIndices &other) const noexcept |
compare operator | |
bool | operator== (const std::vector< uint16_t > &other) const noexcept |
compare to vector | |
bool | operator!= (const SeedIndices &other) const noexcept |
compare operator | |
bool | operator!= (const std::vector< uint16_t > &other) const noexcept |
compare to vector | |
const std::string | numeric (const std::string &separator="") const noexcept |
Get numeric representation 4 digits per 2 bytes concatenated without separator. | |
const std::string | hex (const std::string &separator="") const noexcept |
Get hex representation 4 digits per 2 bytes concatenated without separator. | |
~SeedIndices () | |
Destructor that wipes memory. | |
size_t | size () const noexcept |
Get vector size. | |
bool | empty () const noexcept |
Check if vector is empty. | |
void | clear () noexcept |
Clear indices. | |
void | reserve (size_t n) |
Reserve elements. | |
void | shrink_to_fit () |
shrink to fit | |
uint16_t & | operator[] (size_t pos) |
Element access. | |
const uint16_t & | operator[] (size_t pos) const |
uint16_t & | at (size_t pos) |
const uint16_t & | at (size_t pos) const |
void | push_back (uint16_t value) |
Add index. | |
uint16_t | emplace_back (uint16_t value) |
Add index. | |
auto | begin () noexcept |
Iterator support. | |
auto | end () noexcept |
Iterator support. | |
auto | begin () const noexcept |
Iterator support. | |
auto | end () const noexcept |
Iterator support. | |
auto | cbegin () const noexcept |
Iterator support. | |
auto | cend () const noexcept |
Iterator support. | |
Static Public Member Functions | |
static SeedIndices | fromNumeric (const std::string &numeric, const std::string &separator="") |
Create SeedIndices from numeric representation. | |
static SeedIndices | fromHex (const std::string &hex, const std::string &separator="") |
Create SeedIndices from hex representation. | |
Secure container for seed word indices.
|
defaultnoexcept |
Default constructor.
|
inlineexplicit |
Construct from std::vector.
|
inlineexplicit |
Construct with size.
|
inline |
Construct with size and value.
|
inline |
Copy constructor.
|
inlinenoexcept |
Move constructor.
ots::SeedIndices::~SeedIndices | ( | ) |
Destructor that wipes memory.
uint16_t & ots::SeedIndices::at | ( | size_t | pos | ) |
const uint16_t & ots::SeedIndices::at | ( | size_t | pos | ) | const |
|
inlinenoexcept |
Iterator support.
|
inlinenoexcept |
Iterator support.
|
inlinenoexcept |
Iterator support.
|
inlinenoexcept |
Iterator support.
|
noexcept |
Clear indices.
uint16_t ots::SeedIndices::emplace_back | ( | uint16_t | value | ) |
Add index.
|
noexcept |
Check if vector is empty.
|
inlinenoexcept |
Iterator support.
|
inlinenoexcept |
Iterator support.
|
static |
Create SeedIndices from hex representation.
hex | hex representation of the seed |
separator | optional separator between the digits |
|
static |
Create SeedIndices from numeric representation.
numeric | numeric representation of the seed |
separator | optional separator between the digits |
|
noexcept |
Get hex representation 4 digits per 2 bytes concatenated without separator.
separator | optional separator between the digits |
|
noexcept |
Get numeric representation 4 digits per 2 bytes concatenated without separator.
separator | optional separator between the digits |
|
noexcept |
conversion to const char*,
|
noexcept |
Conversion to std::string.
|
noexcept |
conversion to const std::vector<uint16_t>&
|
noexcept |
conversion to const uint8_t*,
|
noexcept |
compare operator
|
noexcept |
compare to vector
SeedIndices & ots::SeedIndices::operator= | ( | const SeedIndices & | other | ) |
Copy assignment operator.
|
noexcept |
Move assignment operator.
|
noexcept |
compare operator
|
noexcept |
compare to vector
uint16_t & ots::SeedIndices::operator[] | ( | size_t | pos | ) |
Element access.
const uint16_t & ots::SeedIndices::operator[] | ( | size_t | pos | ) | const |
void ots::SeedIndices::push_back | ( | uint16_t | value | ) |
Add index.
|
inline |
Reserve elements.
|
inline |
shrink to fit
|
noexcept |
Get vector size.