mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-06-18 04:00:03 +02:00
src/key_search_helpers.cpp: add key_contains_word()
This commit is contained in:
parent
1c3d503369
commit
bae3721211
2 changed files with 19 additions and 1 deletions
|
|
@ -9,3 +9,17 @@ void key_search_result(const std::string& word, const struct ec_keypair* pair) {
|
|||
std::cout << "Found: " << word << std::endl;
|
||||
wif_print_key(pair);
|
||||
}
|
||||
|
||||
bool key_contains_word(const struct ec_keypair* key, const strlist_t& word_list, std::string& word) {
|
||||
|
||||
std::string pubstr = wif_pub_encode(key->pub);
|
||||
strtolower(pubstr);
|
||||
|
||||
for(auto const& w: word_list) {
|
||||
if (pubstr.find(w) != std::string::npos) {
|
||||
word = w;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue