|
iota.lib.cpp
IOTA C++ Library
|
#include <seed.hpp>
Public Member Functions | |
| Seed (const Types::Trytes &seed="", int security=2) | |
| Seed (const char *seed, int security=2) | |
| ~Seed ()=default | |
| const Types::Trytes & | toTrytes () const |
| void | setSeed (const Types::Trytes &seed) |
| void | setSecurity (int security) |
| int | getSecurity () const |
| Models::Address | newAddress (int32_t index, int32_t security=0) const |
| bool | operator== (const Seed &rhs) const |
| bool | operator!= (const Seed &rhs) const |
| bool | operator== (const Types::Trytes &rhs) const |
| bool | operator!= (const Types::Trytes &rhs) const |
Static Public Member Functions | |
| static Seed | generateRandomSeed () |
| static Models::Address | newAddress (const Models::Seed &seed, int32_t index, int32_t security=0) |
Used to store seeds. Provides validity checks at construction / value set. Any seeds stored represented with this class are ensured to be valid.
| IOTA::Models::Seed::Seed | ( | const Types::Trytes & | seed = "", |
| int | security = 2 |
||
| ) |
Ctor.
| seed | the seed value. It must be a valid seed. |
| security | Security level of the seed. Must be between 1 (low, fast) and 3 (high slow). |
| IOTA::Models::Seed::Seed | ( | const char * | seed, |
| int | security = 2 |
||
| ) |
Ctor, char* based to make implicitly convertion to Seed more flexible.
| seed | the seed value. It must be a valid seed. |
| security | Security level of the seed. Must be between 1 (low, fast) and 3 (high slow). |
|
default |
Default dtor.
|
static |
Generate seed randomly
| int IOTA::Models::Seed::getSecurity | ( | ) | const |
| Models::Address IOTA::Models::Seed::newAddress | ( | int32_t | index, |
| int32_t | security = 0 |
||
| ) | const |
Generates a new address.
| index | The index to start the generation from. |
| security | If set to 0, use the seed security. Otherwise, use the specified security. |
|
static |
Generates a new address.
| seed | The tryte-encoded seed. |
| index | The index to start search from. |
| security | If set to 0, use the seed security. Otherwise, use the specified security. |
| bool IOTA::Models::Seed::operator!= | ( | const Seed & | rhs | ) | const |
Comparison operator.
| rhs | other object to compare with. |
| bool IOTA::Models::Seed::operator!= | ( | const Types::Trytes & | rhs | ) | const |
Comparison operator, trytes-based for convenient use
| rhs | other object to compare with. |
| bool IOTA::Models::Seed::operator== | ( | const Seed & | rhs | ) | const |
Comparison operator.
| rhs | other object to compare with. |
| bool IOTA::Models::Seed::operator== | ( | const Types::Trytes & | rhs | ) | const |
Comparison operator, trytes-based for convenient use
| rhs | other object to compare with. |
| void IOTA::Models::Seed::setSecurity | ( | int | security | ) |
Set the seed security. Must be between 1 (low, fast) and 3 (high slow).
| security | the new security level of the seed. |
| void IOTA::Models::Seed::setSeed | ( | const Types::Trytes & | seed | ) |
Set the seed value
| seed | the seed value. It must be a valid seed. |
| const Types::Trytes& IOTA::Models::Seed::toTrytes | ( | ) | const |
1.8.14