1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-17 03:50:03 +02:00

src/main.cpp: Do case insensitive search

This commit is contained in:
Henrik Hautakoski 2019-12-20 14:28:46 +01:00
parent fd03346255
commit c5ebd757fa

View file

@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <algorithm>
#include <iostream>
#include <cstring>
#include "utils.h"
@ -43,11 +44,13 @@ static void search(const char *words, size_t n) {
std::cout << "Searching for " << n << " keys containing: " << words << std::endl;
word_list = strsplit(words, ",");
std::for_each(word_list.begin(), word_list.end(), strtolower);
while (count < n) {
std::string pubstr;
ec_generate_key(&pair);
pubstr = wif_pub_encode(pair.pub);
strtolower(pubstr);
for(auto const& word: word_list) {
if (pubstr.find(word) != std::string::npos) {