We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bool rai::uint256_union::decode_account (std::string const & source_a) { auto error (source_a.size () < 5); if (!error) { auto xrb_prefix (source_a[0] == 'x' && source_a[1] == 'r' && source_a[2] == 'b' && (source_a[3] == '_' || source_a[3] == '-')); auto nano_prefix (source_a[0] == 'n' && source_a[1] == 'a' && source_a[2] == 'n' && source_a[3] == 'o' && (source_a[4] == '_' || source_a[4] == '-')); error = (xrb_prefix && source_a.size () != 64) || (nano_prefix && source_a.size () != 65); if (!error) { if (xrb_prefix || nano_prefix) { auto i (source_a.begin () + (xrb_prefix ? 4 : 5)); if (*i == '1' || *i == '3') { rai::uint512_t number_l; for (auto j (source_a.end ()); !error && i != j; ++i) { uint8_t character (*i); error = character < 0x30 || character >= 0x80; if (!error) { uint8_t byte (account_decode (character)); error = byte == '~'; // Invalid judgement, account_decode never return ~ if (!error) { number_l <<= 5; number_l += byte; } } } if (!error) { *this = (number_l >> 40).convert_to<rai::uint256_t> (); uint64_t check (number_l & static_cast<uint64_t> (0xffffffffff)); uint64_t validation (0); blake2b_state hash; blake2b_init (&hash, 5); blake2b_update (&hash, bytes.data (), bytes.size ()); blake2b_final (&hash, reinterpret_cast<uint8_t *> (&validation), 5); error = check != validation; } } else { error = true; } } else { error = true; } } } return error; }
The text was updated successfully, but these errors were encountered:
Can you provide more specific information ?
Sorry, something went wrong.
Nevermind, @PlasmaPower spotted the comment and helped me !
rkeene
No branches or pull requests
The text was updated successfully, but these errors were encountered: