mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-07-03 11:53:41 +02:00
src/main.cpp: implement "--l33t" flag.
This commit is contained in:
parent
237fc4e4af
commit
f6e4603cbe
1 changed files with 21 additions and 1 deletions
22
src/main.cpp
22
src/main.cpp
|
|
@ -33,6 +33,9 @@
|
||||||
#include "ec.h"
|
#include "ec.h"
|
||||||
#include "key_search.h"
|
#include "key_search.h"
|
||||||
|
|
||||||
|
// Command line options.
|
||||||
|
bool option_l33t = false;
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
#define n_thread_decl int n_threads = std::thread::hardware_concurrency()
|
#define n_thread_decl int n_threads = std::thread::hardware_concurrency()
|
||||||
#define n_thread_argv \
|
#define n_thread_argv \
|
||||||
|
|
@ -56,7 +59,18 @@ void cmd_search(int argc, char **argv) {
|
||||||
int n = 100;
|
int n = 100;
|
||||||
n_thread_decl;
|
n_thread_decl;
|
||||||
std::string search(argv[0]);
|
std::string search(argv[0]);
|
||||||
strlist_t words = strsplitwords(strtolower(base58_strip(search)));
|
strlist_t words;
|
||||||
|
|
||||||
|
if (option_l33t) {
|
||||||
|
strlist_t tmp = strsplitwords(search);
|
||||||
|
for(int i = 0; i < tmp.size(); i++) {
|
||||||
|
strlist_t list = l33twords(base58_strip(tmp[i]));
|
||||||
|
words.reserve(words.size() + list.size());
|
||||||
|
words.insert(words.end(), list.begin(), list.end());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
words = strsplitwords(strtolower(base58_strip(search)));
|
||||||
|
}
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
n = atoi(argv[1]);
|
n = atoi(argv[1]);
|
||||||
|
|
@ -105,6 +119,12 @@ int main(int argc, char **argv) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!strcmp(argv[1], "--l33t")) {
|
||||||
|
option_l33t = true;
|
||||||
|
argc--;
|
||||||
|
argv = &argv[1];
|
||||||
|
}
|
||||||
|
|
||||||
if (!strcmp(argv[1], "search")) {
|
if (!strcmp(argv[1], "search")) {
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
std::cout << "You must specify a word list." << std::endl;
|
std::cout << "You must specify a word list." << std::endl;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue