mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-06-18 04:00:03 +02:00
rename namespace and header guards from eosio to antelope
This commit is contained in:
parent
2679dc6ef4
commit
2b4ab78176
35 changed files with 126 additions and 127 deletions
|
|
@ -25,7 +25,7 @@
|
|||
#include <libantelope/ec.hpp>
|
||||
#include "benchmark.hpp"
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
std::chrono::duration<float> _run_benchmark(size_t num_keys) {
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
|
|
@ -47,4 +47,4 @@ void benchmark(size_t num_keys, struct benchmark_result* res) {
|
|||
res->kps = static_cast<float>(num_keys) / res->sec;
|
||||
}
|
||||
|
||||
} // namespace eoskeygen
|
||||
} // namespace antelopekeygen
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <ctime>
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
struct benchmark_result {
|
||||
float sec; // elapsed seconds.
|
||||
|
|
@ -35,6 +35,6 @@ struct benchmark_result {
|
|||
|
||||
void benchmark(size_t num_keys, struct benchmark_result* res);
|
||||
|
||||
} // namespace eoskeygen
|
||||
} // namespace antelopekeygen
|
||||
|
||||
#endif /* EOSIOKEYGEN_BENCHMARK_H */
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include "console.hpp"
|
||||
#include "cli_key_search_result.hpp"
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
static size_t highlight(console::Color color, const std::string& str, size_t pos, size_t len) {
|
||||
|
||||
|
|
@ -74,4 +74,4 @@ void CliKeySearchResult::onResult(const struct libantelope::ec_keypair* key, con
|
|||
<< "Private: " << libantelope::wif_priv_encode(key->secret, m_codec.pvt) << std::endl;
|
||||
}
|
||||
|
||||
} // namespace eoskeygen
|
||||
} // namespace antelopekeygen
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include <eoskeygen/key_search.hpp>
|
||||
#include <eoskeygen/key_search_result.hpp>
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
class Dictionary;
|
||||
|
||||
|
|
@ -49,6 +49,6 @@ protected :
|
|||
libantelope::wif_codec_t m_codec;
|
||||
};
|
||||
|
||||
} // namespace eoskeygen
|
||||
} // namespace antelopekeygen
|
||||
|
||||
#endif /* EOSIOKEYGEN_KEY_SEARCH_HELPERS_H */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include "isatty.hpp"
|
||||
#include "console.hpp"
|
||||
|
||||
namespace eoskeygen { namespace console {
|
||||
namespace antelopekeygen { namespace console {
|
||||
|
||||
bool disable_color = false;
|
||||
|
||||
|
|
@ -45,4 +45,4 @@ bool isColorsSupported(const std::ostream& os) {
|
|||
return disable_color == false && isatty(fd);
|
||||
}
|
||||
|
||||
} } // namespace eoskeygen::console
|
||||
} } // namespace antelopekeygen::console
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <ostream>
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
namespace console {
|
||||
|
||||
|
|
@ -86,6 +86,6 @@ namespace console {
|
|||
|
||||
} // namespace console
|
||||
|
||||
} // namespace eoskeygen
|
||||
} // namespace antelopekeygen
|
||||
|
||||
#endif /* EOSIOKEYGEN_CONSOLE_H */
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include <iostream>
|
||||
#include "console.hpp"
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
namespace console {
|
||||
|
||||
|
|
@ -80,4 +80,4 @@ std::ostream& operator<<(std::ostream& os, const fg& obj) {
|
|||
|
||||
} // namespace console
|
||||
|
||||
} // namespace eoskeygen
|
||||
} // namespace antelopekeygen
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include <iostream>
|
||||
#include "console.hpp"
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
// WinAPI colors
|
||||
#define FG_BLACK 0
|
||||
|
|
@ -105,4 +105,4 @@ std::ostream& operator<<(std::ostream& os, const fg& obj) {
|
|||
|
||||
} // namespace console
|
||||
|
||||
} // namespace eoskeygen
|
||||
} // namespace antelopekeygen
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#endif
|
||||
#include "isatty.hpp"
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
bool isatty(int fd) {
|
||||
return ::_isatty(fd);
|
||||
|
|
@ -42,4 +42,4 @@ bool isatty(FILE* fd) {
|
|||
return fd ? isatty(_fileno(fd)) : false;
|
||||
}
|
||||
|
||||
} // namespace eoskeygen
|
||||
} // namespace antelopekeygen
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
bool isatty(int fd);
|
||||
|
||||
bool isatty(FILE* fd);
|
||||
|
||||
} // namespace eoskeygen
|
||||
} // namespace antelopekeygen
|
||||
|
||||
#endif /* EOSIOKEYGEN_CORE_ISATTY_H */
|
||||
|
|
|
|||
|
|
@ -62,10 +62,10 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
int cmd_search(const eoskeygen::strlist_t& words, const eoskeygen::Dictionary& dict, int count) {
|
||||
int cmd_search(const antelopekeygen::strlist_t& words, const antelopekeygen::Dictionary& dict, int count) {
|
||||
|
||||
eoskeygen::KeySearch ks;
|
||||
eoskeygen::CliKeySearchResult rs(dict, key_codec);
|
||||
antelopekeygen::KeySearch ks;
|
||||
antelopekeygen::CliKeySearchResult rs(dict, key_codec);
|
||||
|
||||
ks.setPrefix(key_codec.pub);
|
||||
ks.setCallback(&rs);
|
||||
|
|
@ -82,7 +82,7 @@ int cmd_search(const eoskeygen::strlist_t& words, const eoskeygen::Dictionary& d
|
|||
|
||||
if (option_l33t) {
|
||||
for(std::size_t i = 0; i < words.size(); i++) {
|
||||
ks.addList(eoskeygen::l33twords(words[i]));
|
||||
ks.addList(antelopekeygen::l33twords(words[i]));
|
||||
}
|
||||
} else {
|
||||
ks.addList(words);
|
||||
|
|
@ -93,7 +93,7 @@ int cmd_search(const eoskeygen::strlist_t& words, const eoskeygen::Dictionary& d
|
|||
#endif /* EOSIOKEYGEN_HAVE_THREADS */
|
||||
|
||||
std::cout << "Searching for " << count
|
||||
<< " keys containing: " << eoskeygen::strlist::join(ks.getList(), ",")
|
||||
<< " keys containing: " << antelopekeygen::strlist::join(ks.getList(), ",")
|
||||
#ifdef EOSIOKEYGEN_HAVE_THREADS
|
||||
<< ", Using: " << ks.getThreadCount() << " threads"
|
||||
#endif /* EOSIOKEYGEN_HAVE_THREADS */
|
||||
|
|
@ -106,12 +106,12 @@ int cmd_search(const eoskeygen::strlist_t& words, const eoskeygen::Dictionary& d
|
|||
|
||||
void cmd_benchmark(size_t num_keys) {
|
||||
|
||||
struct eoskeygen::benchmark_result res;
|
||||
struct antelopekeygen::benchmark_result res;
|
||||
|
||||
std::cout << "Benchmark: Generating "
|
||||
<< num_keys << " keys" << std::endl;
|
||||
|
||||
eoskeygen::benchmark(num_keys, &res);
|
||||
antelopekeygen::benchmark(num_keys, &res);
|
||||
|
||||
std::cout << "Result: Took " << res.sec << " seconds, "
|
||||
<< res.kps << " keys per second." << std::endl;
|
||||
|
|
@ -146,7 +146,7 @@ int main(int argc, char **argv) {
|
|||
search_cmd->add_option("--threads", option_num_threads,
|
||||
"Use <num> of parallel threads for searching.\n"
|
||||
"Default is what the operating system recomends.")
|
||||
->default_val(eoskeygen::KeySearch::max_threads());
|
||||
->default_val(antelopekeygen::KeySearch::max_threads());
|
||||
|
||||
#endif /* EOSIOKEYGEN_HAVE_THREADS */
|
||||
|
||||
|
|
@ -185,15 +185,15 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if (search_cmd->parsed()) {
|
||||
eoskeygen::strlist_t words;
|
||||
eoskeygen::Dictionary dict;
|
||||
antelopekeygen::strlist_t words;
|
||||
antelopekeygen::Dictionary dict;
|
||||
|
||||
if (*monocrome) {
|
||||
eoskeygen::console::disable_color = true;
|
||||
antelopekeygen::console::disable_color = true;
|
||||
}
|
||||
|
||||
for (auto item : dict_list) {
|
||||
eoskeygen::Dictionary d;
|
||||
antelopekeygen::Dictionary d;
|
||||
|
||||
if (d.loadFromFile(item)) {
|
||||
dict.add(d);
|
||||
|
|
@ -203,7 +203,7 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
for (auto item : lang_list) {
|
||||
eoskeygen::Dictionary d;
|
||||
antelopekeygen::Dictionary d;
|
||||
std::string filename(CONFIG_SHARE_FULL_PATH "/dicts/" + item);
|
||||
|
||||
if (d.loadFromFile(filename)) {
|
||||
|
|
@ -215,7 +215,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
if (search_words.rfind("file:", 0) == 0) {
|
||||
std::string filename = search_words.substr(5);
|
||||
if (!eoskeygen::readLines(filename, words)) {
|
||||
if (!antelopekeygen::readLines(filename, words)) {
|
||||
std::cerr << "Could not read file: " << filename << std::endl;
|
||||
goto end;
|
||||
}
|
||||
|
|
@ -225,7 +225,7 @@ int main(int argc, char **argv) {
|
|||
goto end;
|
||||
}
|
||||
} else {
|
||||
words = eoskeygen::strlist::splitw(search_words);
|
||||
words = antelopekeygen::strlist::splitw(search_words);
|
||||
}
|
||||
|
||||
rc = cmd_search(words, dict, search_count);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue