14 std::vector<uint32_t> &
keypath) {
18 while (std::getline(
ss, item,
'/')) {
19 if (item.compare(
"m") == 0) {
28 size_t pos = item.find(
"'");
29 if (pos != std::string::npos) {
31 if (pos != item.size() - 1) {
36 item = item.substr(0, item.size() - 1);
40 if (item.find_first_not_of(
"0123456789") != std::string::npos) {
bool ParseHDKeypath(const std::string &keypath_str, std::vector< uint32_t > &keypath)
Parse an HD keypaths like "m/7/0'/2000".
std::string FormatHDKeypath(const std::vector< uint32_t > &path)
std::string WriteHDKeypath(const std::vector< uint32_t > &keypath)
Write HD keypaths as strings.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
bool ParseUInt32(std::string_view str, uint32_t *out)
Convert decimal string to unsigned 32-bit integer with strict parse error feedback.