From 2b4ab781764ad189e767e2802b71f7edaf598125 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 10 Apr 2023 14:53:26 +0200 Subject: [PATCH] rename namespace and header guards from eosio to antelope --- CMakeLists.txt | 8 ++--- README.md | 9 +++--- cli/CMakeLists.txt | 4 +-- cli/docs/README.md.in | 10 +++---- ...eosio-keygen.1.in => antelope-keygen.1.in} | 0 cli/src/benchmark.cpp | 4 +-- cli/src/benchmark.hpp | 4 +-- cli/src/cli_key_search_result.cpp | 4 +-- cli/src/cli_key_search_result.hpp | 4 +-- cli/src/console.cpp | 4 +-- cli/src/console.hpp | 4 +-- cli/src/console_ansi.cpp | 4 +-- cli/src/console_win32.cpp | 4 +-- cli/src/isatty.cpp | 4 +-- cli/src/isatty.hpp | 4 +-- cli/src/main.cpp | 30 +++++++++---------- common/CMakeLists.txt | 2 +- common/config.hpp.in | 8 ++--- common/include/eoskeygen/core/dictionary.hpp | 10 +++---- common/include/eoskeygen/core/file.hpp | 8 ++--- common/include/eoskeygen/core/leet.hpp | 10 +++---- common/include/eoskeygen/core/string.hpp | 10 +++---- common/include/eoskeygen/core/strlist.hpp | 10 +++---- common/include/eoskeygen/key_search.hpp | 22 +++++++------- .../include/eoskeygen/key_search_result.hpp | 10 +++---- common/src/core/dictionary.cpp | 4 +-- common/src/core/file.cpp | 4 +-- common/src/core/leet.cpp | 4 +-- common/src/core/string.cpp | 4 +-- common/src/core/strlist.cpp | 6 ++-- common/src/key_search.cpp | 4 +-- common/src/key_search_mt.cpp | 4 +-- gui/CMakeLists.txt | 4 +-- gui/src/SearchWindow.cpp | 20 ++++++------- gui/src/SearchWindow.hpp | 8 ++--- 35 files changed, 126 insertions(+), 127 deletions(-) rename cli/docs/{eosio-keygen.1.in => antelope-keygen.1.in} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b39969..df118dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,10 +4,10 @@ cmake_minimum_required(VERSION 3.15) # Project Info # -------------------------------- -project(eosio-keygen +project(antelope-keygen VERSION 1.0.8 - DESCRIPTION "Keygenerator for EOSIO" - HOMEPAGE_URL "https://github.com/eosswedenorg/eosio-keygen" ) + DESCRIPTION "Keygenerator for Antelope blockchain" + HOMEPAGE_URL "https://github.com/eosswedenorg/antelope-keygen" ) set( PROJECT_MAINTAINER "Henrik Hautakoski ") set( PROJECT_LICENSE_FILE ${CMAKE_CURRENT_LIST_DIR}/LICENSE ) @@ -102,7 +102,7 @@ set( CMAKE_POSITION_INDEPENDENT_CODE TRUE ) configure_file(config.hpp.in "${PROJECT_BINARY_DIR}/config.hpp" @ONLY) include_directories(${PROJECT_BINARY_DIR}) -# Bundle eosio-extras on windows. +# Bundle antelope-extras on windows. if (WIN32) include(extras) list(APPEND components extras ) diff --git a/README.md b/README.md index d3f7223..30c0ce9 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -![](https://github.com/eosswedenorg/eosio-keygen/workflows/CI/badge.svg) -[![GitHub release](https://img.shields.io/github/v/release/eosswedenorg/eosio-keygen?include_prereleases)](https://github.com/eosswedenorg/eosio-keygen/releases/latest) +![](https://github.com/eosswedenorg/antelope-keygen/workflows/CI/badge.svg) +[![GitHub release](https://img.shields.io/github/v/release/eosswedenorg/antelope-keygen?include_prereleases)](https://github.com/eosswedenorg/antelope-keygen/releases/latest) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -# EOSIO Keygen +# Antelope Keygen -This program generates public and private keypair for [EOS](https://eos.io/) +This program generates public and private keypair for [Antelope IO](https://antelope.io) ## Compile @@ -164,7 +164,6 @@ $ curl https://apt.eossweden.org/key 2> /dev/null | sudo apt-key add - $ sudo apt-add-repository -y 'deb [arch=amd64] https://apt.eossweden.org/main `lsb_release -cs` stable' $ sudo apt-get install libantelope-dev ``` - or manually via `.deb` file from [github](https://github.com/eosswedenorg/libantelope/releases) ```sh diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index b769020..087b24d 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.15) # Project Info # -------------------------------- -project(eosio-keygen +project(antelope-keygen VERSION ${CMAKE_PROJECT_VERSION} LANGUAGES CXX) @@ -67,7 +67,7 @@ install(FILES ${PROJECT_BINARY_DIR}/README.cli.md COMPONENT cli) if (UNIX) - configure_file( docs/eosio-keygen.1.in ${PROJECT_BINARY_DIR}/man1/eosio-keygen.1 ) + configure_file( docs/antelope-keygen.1.in ${PROJECT_BINARY_DIR}/man1/antelope-keygen.1 ) install(DIRECTORY ${PROJECT_BINARY_DIR}/man1 DESTINATION ${CMAKE_INSTALL_MANDIR} diff --git a/cli/docs/README.md.in b/cli/docs/README.md.in index d387386..b3e0b98 100644 --- a/cli/docs/README.md.in +++ b/cli/docs/README.md.in @@ -1,9 +1,9 @@ -# eosio-keygen (cli) +# antelope-keygen (cli) -Generate public and private keypair for [EOSIO](https://eos.io/) +Generate public and private keypair for [Antelope IO](https://antelope.io) -Source code is available at [github.com](https://github.com/eosswedenorg/eosio-keygen) +Source code is available at [github.com](https://github.com/eosswedenorg/antelope-keygen) ## Synopsis @@ -19,7 +19,7 @@ Source code is available at [github.com](https://github.com/eosswedenorg/eosio-k ## Description -Output one EOSIO key pair if no arguments are given. +Output one Antelope key pair if no arguments are given. Options and subcommands are as follows: ### General flags @@ -70,7 +70,7 @@ Number of keys to search for (default is 10) ### benchmark command -`eosio-keygen benchmark [num_keys]` +`antelope-keygen benchmark [num_keys]` performs a benchmark test, generating `num_keys` keys and measuring the time. diff --git a/cli/docs/eosio-keygen.1.in b/cli/docs/antelope-keygen.1.in similarity index 100% rename from cli/docs/eosio-keygen.1.in rename to cli/docs/antelope-keygen.1.in diff --git a/cli/src/benchmark.cpp b/cli/src/benchmark.cpp index b0a32b9..01a8bbf 100644 --- a/cli/src/benchmark.cpp +++ b/cli/src/benchmark.cpp @@ -25,7 +25,7 @@ #include #include "benchmark.hpp" -namespace eoskeygen { +namespace antelopekeygen { std::chrono::duration _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(num_keys) / res->sec; } -} // namespace eoskeygen +} // namespace antelopekeygen diff --git a/cli/src/benchmark.hpp b/cli/src/benchmark.hpp index 9300cc3..180872e 100644 --- a/cli/src/benchmark.hpp +++ b/cli/src/benchmark.hpp @@ -26,7 +26,7 @@ #include -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 */ diff --git a/cli/src/cli_key_search_result.cpp b/cli/src/cli_key_search_result.cpp index aaa9f97..d70b7cb 100644 --- a/cli/src/cli_key_search_result.cpp +++ b/cli/src/cli_key_search_result.cpp @@ -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 diff --git a/cli/src/cli_key_search_result.hpp b/cli/src/cli_key_search_result.hpp index 0d0a1a5..1428477 100644 --- a/cli/src/cli_key_search_result.hpp +++ b/cli/src/cli_key_search_result.hpp @@ -31,7 +31,7 @@ #include #include -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 */ diff --git a/cli/src/console.cpp b/cli/src/console.cpp index ebcfe1f..9b3529d 100644 --- a/cli/src/console.cpp +++ b/cli/src/console.cpp @@ -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 diff --git a/cli/src/console.hpp b/cli/src/console.hpp index f847f75..0dd2c46 100644 --- a/cli/src/console.hpp +++ b/cli/src/console.hpp @@ -26,7 +26,7 @@ #include -namespace eoskeygen { +namespace antelopekeygen { namespace console { @@ -86,6 +86,6 @@ namespace console { } // namespace console -} // namespace eoskeygen +} // namespace antelopekeygen #endif /* EOSIOKEYGEN_CONSOLE_H */ diff --git a/cli/src/console_ansi.cpp b/cli/src/console_ansi.cpp index 5cf5850..f49006c 100644 --- a/cli/src/console_ansi.cpp +++ b/cli/src/console_ansi.cpp @@ -24,7 +24,7 @@ #include #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 diff --git a/cli/src/console_win32.cpp b/cli/src/console_win32.cpp index 3b13f5a..ec3b1b1 100644 --- a/cli/src/console_win32.cpp +++ b/cli/src/console_win32.cpp @@ -25,7 +25,7 @@ #include #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 diff --git a/cli/src/isatty.cpp b/cli/src/isatty.cpp index ea03397..75d0778 100644 --- a/cli/src/isatty.cpp +++ b/cli/src/isatty.cpp @@ -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 diff --git a/cli/src/isatty.hpp b/cli/src/isatty.hpp index 0b724af..54d1e00 100644 --- a/cli/src/isatty.hpp +++ b/cli/src/isatty.hpp @@ -26,12 +26,12 @@ #include -namespace eoskeygen { +namespace antelopekeygen { bool isatty(int fd); bool isatty(FILE* fd); -} // namespace eoskeygen +} // namespace antelopekeygen #endif /* EOSIOKEYGEN_CORE_ISATTY_H */ diff --git a/cli/src/main.cpp b/cli/src/main.cpp index 5351444..f9205c7 100644 --- a/cli/src/main.cpp +++ b/cli/src/main.cpp @@ -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 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); diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 0acf3ec..eb3e3a7 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -28,7 +28,7 @@ set( COMMON_SOURCE if (USE_THREADS) find_package(Threads) if (Threads_FOUND) - set( EOSIOKEYGEN_HAVE_THREADS TRUE ) + set( ANTELOPEKEYGEN_HAVE_THREADS TRUE ) set( COMMON_SOURCE ${COMMON_SOURCE} src/key_search_mt.cpp ) endif (Threads_FOUND) endif (USE_THREADS) diff --git a/common/config.hpp.in b/common/config.hpp.in index 8b1d7f9..1cbe1c8 100644 --- a/common/config.hpp.in +++ b/common/config.hpp.in @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef EOSIOKEYGEN_COMMON_CONFIG_H -#define EOSIOKEYGEN_COMMON_CONFIG_H +#ifndef ANTELOPEKEYGEN_COMMON_CONFIG_H +#define ANTELOPEKEYGEN_COMMON_CONFIG_H // Defined if we have thread support. -#cmakedefine EOSIOKEYGEN_HAVE_THREADS +#cmakedefine ANTELOPEKEYGEN_HAVE_THREADS -#endif /* EOSIOKEYGEN_COMMON_CONFIG_H */ +#endif /* ANTELOPEKEYGEN_COMMON_CONFIG_H */ diff --git a/common/include/eoskeygen/core/dictionary.hpp b/common/include/eoskeygen/core/dictionary.hpp index 4a939c0..8008a30 100644 --- a/common/include/eoskeygen/core/dictionary.hpp +++ b/common/include/eoskeygen/core/dictionary.hpp @@ -21,14 +21,14 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef EOSIOKEYGEN_COMMON_CORE_DICTIONARY_H -#define EOSIOKEYGEN_COMMON_CORE_DICTIONARY_H +#ifndef ANTELOPEKEYGEN_COMMON_CORE_DICTIONARY_H +#define ANTELOPEKEYGEN_COMMON_CORE_DICTIONARY_H #include #include #include -namespace eoskeygen { +namespace antelopekeygen { class Dictionary { @@ -70,6 +70,6 @@ protected : std::set m_words; }; -} // namespace eoskeygen +} // namespace antelopekeygen -#endif /* EOSIOKEYGEN_COMMON_CORE_DICTIONARY_H */ +#endif /* ANTELOPEKEYGEN_COMMON_CORE_DICTIONARY_H */ diff --git a/common/include/eoskeygen/core/file.hpp b/common/include/eoskeygen/core/file.hpp index 330c974..15ec64c 100644 --- a/common/include/eoskeygen/core/file.hpp +++ b/common/include/eoskeygen/core/file.hpp @@ -21,15 +21,15 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef EOSIOKEYGEN_COMMON_CORE_FILE_H -#define EOSIOKEYGEN_COMMON_CORE_FILE_H +#ifndef ANTELOPEKEYGEN_COMMON_CORE_FILE_H +#define ANTELOPEKEYGEN_COMMON_CORE_FILE_H #include -namespace eoskeygen { +namespace antelopekeygen { bool readLines(const std::string& filename, strlist_t& lines); } // namespace -#endif /* EOSIOKEYGEN_COMMON_CORE_FILE_H */ +#endif /* ANTELOPEKEYGEN_COMMON_CORE_FILE_H */ diff --git a/common/include/eoskeygen/core/leet.hpp b/common/include/eoskeygen/core/leet.hpp index 29eea80..6cc3796 100644 --- a/common/include/eoskeygen/core/leet.hpp +++ b/common/include/eoskeygen/core/leet.hpp @@ -21,16 +21,16 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef EOSIOKEYGEN_COMMON_CORE_LEET_H -#define EOSIOKEYGEN_COMMON_CORE_LEET_H +#ifndef ANTELOPEKEYGEN_COMMON_CORE_LEET_H +#define ANTELOPEKEYGEN_COMMON_CORE_LEET_H #include #include -namespace eoskeygen { +namespace antelopekeygen { strlist_t l33twords(std::string str); -} // namespace eoskeygen +} // namespace antelopekeygen -#endif /* EOSIOKEYGEN_COMMON_CORE_LEET_H */ +#endif /* ANTELOPEKEYGEN_COMMON_CORE_LEET_H */ diff --git a/common/include/eoskeygen/core/string.hpp b/common/include/eoskeygen/core/string.hpp index 4e008c0..a1ef0dc 100644 --- a/common/include/eoskeygen/core/string.hpp +++ b/common/include/eoskeygen/core/string.hpp @@ -21,13 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef EOSIOKEYGEN_COMMON_CORE_STRING_H -#define EOSIOKEYGEN_COMMON_CORE_STRING_H +#ifndef ANTELOPEKEYGEN_COMMON_CORE_STRING_H +#define ANTELOPEKEYGEN_COMMON_CORE_STRING_H #include #include -namespace eoskeygen { +namespace antelopekeygen { std::string& strtolower(std::string& str); @@ -35,6 +35,6 @@ std::string& rtrim(std::string& str); std::string& ltrim(std::string& str); std::string& trim(std::string& str); -} // namespace eoskeygen +} // namespace antelopekeygen -#endif /* EOSIOKEYGEN_COMMON_CORE_STRING_H */ +#endif /* ANTELOPEKEYGEN_COMMON_CORE_STRING_H */ diff --git a/common/include/eoskeygen/core/strlist.hpp b/common/include/eoskeygen/core/strlist.hpp index 96f509e..2cc63b6 100644 --- a/common/include/eoskeygen/core/strlist.hpp +++ b/common/include/eoskeygen/core/strlist.hpp @@ -21,13 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef EOSIOKEYGEN_COMMON_CORE_STRLIST_H -#define EOSIOKEYGEN_COMMON_CORE_STRLIST_H +#ifndef ANTELOPEKEYGEN_COMMON_CORE_STRLIST_H +#define ANTELOPEKEYGEN_COMMON_CORE_STRLIST_H #include #include -namespace eoskeygen { +namespace antelopekeygen { typedef std::vector strlist_t; @@ -45,6 +45,6 @@ strlist_t& strip(strlist_t& list, strlist_stripfunc_t fn); } // namespace strlist -} // namespace eoskeygen +} // namespace antelopekeygen -#endif /* EOSIOKEYGEN_COMMON_CORE_STRLIST_H */ +#endif /* ANTELOPEKEYGEN_COMMON_CORE_STRLIST_H */ diff --git a/common/include/eoskeygen/key_search.hpp b/common/include/eoskeygen/key_search.hpp index 0574575..5e0b9ae 100644 --- a/common/include/eoskeygen/key_search.hpp +++ b/common/include/eoskeygen/key_search.hpp @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef EOSIOKEYGEN_COMMON_KEY_SEARCH_H -#define EOSIOKEYGEN_COMMON_KEY_SEARCH_H +#ifndef ANTELOPEKEYGEN_COMMON_KEY_SEARCH_H +#define ANTELOPEKEYGEN_COMMON_KEY_SEARCH_H #include #include @@ -31,7 +31,7 @@ #include #include -namespace eoskeygen { +namespace antelopekeygen { class IKeySearchResult; @@ -64,7 +64,7 @@ public : // Set callback for search result. void setCallback(IKeySearchResult* callback); -#ifdef EOSIOKEYGEN_HAVE_THREADS +#ifdef ANTELOPEKEYGEN_HAVE_THREADS // Returns the maximum number of threads // reported by the operating system. static size_t max_threads(); @@ -73,7 +73,7 @@ public : void setThreadCount(size_t num); size_t getThreadCount() const; -#endif /* EOSIOKEYGEN_HAVE_THREADS */ +#endif /* ANTELOPEKEYGEN_HAVE_THREADS */ // Aborts find() operation if started. // This is useful for multithreaded code (like GUI application) @@ -90,11 +90,11 @@ protected : // returns true if a word was found (stored in ), false otherwise. bool _contains_word(const struct libantelope::ec_keypair* key, struct result& result); -#ifdef EOSIOKEYGEN_HAVE_THREADS +#ifdef ANTELOPEKEYGEN_HAVE_THREADS void _thr_proc(); void _search_mt(); -#endif /* EOSIOKEYGEN_HAVE_THREADS */ +#endif /* ANTELOPEKEYGEN_HAVE_THREADS */ void _search_linear(); @@ -112,14 +112,14 @@ protected : // Current number of keys found. std::size_t m_count; -#ifdef EOSIOKEYGEN_HAVE_THREADS +#ifdef ANTELOPEKEYGEN_HAVE_THREADS // Number of threads to use. size_t m_threads; -#endif /* EOSIOKEYGEN_HAVE_THREADS */ +#endif /* ANTELOPEKEYGEN_HAVE_THREADS */ IKeySearchResult* m_callback; }; -} // namespace eoskeygen +} // namespace antelopekeygen -#endif /* EOSIOKEYGEN_COMMON_KEY_SEARCH_H */ +#endif /* ANTELOPEKEYGEN_COMMON_KEY_SEARCH_H */ diff --git a/common/include/eoskeygen/key_search_result.hpp b/common/include/eoskeygen/key_search_result.hpp index 7abd975..ef598e0 100644 --- a/common/include/eoskeygen/key_search_result.hpp +++ b/common/include/eoskeygen/key_search_result.hpp @@ -21,12 +21,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef EOSIOKEYGEN_COMMON_KEY_SEARCH_RESULT_H -#define EOSIOKEYGEN_COMMON_KEY_SEARCH_RESULT_H +#ifndef ANTELOPEKEYGEN_COMMON_KEY_SEARCH_RESULT_H +#define ANTELOPEKEYGEN_COMMON_KEY_SEARCH_RESULT_H #include -namespace eoskeygen { +namespace antelopekeygen { class IKeySearchResult { @@ -35,6 +35,6 @@ public : virtual void onResult(const struct libantelope::ec_keypair* key, const struct KeySearch::result& result) = 0; }; -} // namespace eoskeygen +} // namespace antelopekeygen -#endif /* EOSIOKEYGEN_COMMON_KEY_SEARCH_RESULT_H */ +#endif /* ANTELOPEKEYGEN_COMMON_KEY_SEARCH_RESULT_H */ diff --git a/common/src/core/dictionary.cpp b/common/src/core/dictionary.cpp index 806922b..2e5033a 100644 --- a/common/src/core/dictionary.cpp +++ b/common/src/core/dictionary.cpp @@ -29,7 +29,7 @@ #include #include -namespace eoskeygen { +namespace antelopekeygen { struct StringContains { StringContains(const std::string& str, std::vector& pos) : m_str(str), m_pos(pos) {} @@ -126,4 +126,4 @@ Dictionary::search_result_t Dictionary::search(const std::string& subject) const return res; } -} // namespace eoskeygen +} // namespace antelopekeygen diff --git a/common/src/core/file.cpp b/common/src/core/file.cpp index 6cbdac5..500d86b 100644 --- a/common/src/core/file.cpp +++ b/common/src/core/file.cpp @@ -25,7 +25,7 @@ #include #include -namespace eoskeygen { +namespace antelopekeygen { bool readLines(const std::string& filename, strlist_t& lines) { @@ -46,4 +46,4 @@ bool readLines(const std::string& filename, strlist_t& lines) { return true; } -} // namespace eoskeygen +} // namespace antelopekeygen diff --git a/common/src/core/leet.cpp b/common/src/core/leet.cpp index e30e54d..763bc11 100644 --- a/common/src/core/leet.cpp +++ b/common/src/core/leet.cpp @@ -24,7 +24,7 @@ #include #include -namespace eoskeygen { +namespace antelopekeygen { static bool is_l33t(char ch, char& r) { @@ -79,4 +79,4 @@ strlist_t l33twords(std::string str) { return list; } -} // namespace eoskeygen +} // namespace antelopekeygen diff --git a/common/src/core/string.cpp b/common/src/core/string.cpp index 6186556..54acb8a 100644 --- a/common/src/core/string.cpp +++ b/common/src/core/string.cpp @@ -26,7 +26,7 @@ #include #include -namespace eoskeygen { +namespace antelopekeygen { std::string& strtolower(std::string& str) { std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c){ return std::tolower(c); }); @@ -49,4 +49,4 @@ std::string& trim(std::string& str) { return ltrim(rtrim(str)); } -} // namespace eoskeygen +} // namespace antelopekeygen diff --git a/common/src/core/strlist.cpp b/common/src/core/strlist.cpp index 8c8f874..dc3e5db 100644 --- a/common/src/core/strlist.cpp +++ b/common/src/core/strlist.cpp @@ -25,7 +25,7 @@ #include #include -namespace eoskeygen { +namespace antelopekeygen { strlist_t strlist::splitw(const std::string& str, const std::string& delim) { @@ -48,7 +48,7 @@ strlist_t strlist::split(const std::string& str, const std::string& delim) { return r; } -std::string strlist::join(const eoskeygen::strlist_t& list, const std::string& delim) { +std::string strlist::join(const strlist_t& list, const std::string& delim) { std::string out; @@ -72,4 +72,4 @@ strlist_t& strlist::strip(strlist_t& list, strlist_stripfunc_t fn) { return list; } -} // namespace eoskeygen +} // namespace antelopekeygen diff --git a/common/src/key_search.cpp b/common/src/key_search.cpp index 3e11303..d20597d 100644 --- a/common/src/key_search.cpp +++ b/common/src/key_search.cpp @@ -28,7 +28,7 @@ #include #include -namespace eoskeygen { +namespace antelopekeygen { KeySearch::KeySearch() : m_prefix ("EOS"), @@ -128,4 +128,4 @@ bool KeySearch::_contains_word(const struct libantelope::ec_keypair* key, struct return false; } -} // namespace eoskeygen +} // namespace antelopekeygen diff --git a/common/src/key_search_mt.cpp b/common/src/key_search_mt.cpp index 25fa17e..f73a635 100644 --- a/common/src/key_search_mt.cpp +++ b/common/src/key_search_mt.cpp @@ -29,7 +29,7 @@ #include #include -namespace eoskeygen { +namespace antelopekeygen { // Mutex guard for m_count. std::mutex g_count_mtx; @@ -98,4 +98,4 @@ void KeySearch::_search_mt() } } -} // namespace eoskeygen +} // namespace antelopekeygen diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 361dfeb..fec8fec 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.15) -project(eosio-keygen-gui +project(antelope-keygen-gui VERSION ${CMAKE_PROJECT_VERSION} - DESCRIPTION "Keygenerator for EOSIO (gui)" + DESCRIPTION "Keygenerator for Antelope blockchain (gui)" LANGUAGES CXX) # Append modules dir diff --git a/gui/src/SearchWindow.cpp b/gui/src/SearchWindow.cpp index b2b4e60..e4661e2 100644 --- a/gui/src/SearchWindow.cpp +++ b/gui/src/SearchWindow.cpp @@ -72,8 +72,8 @@ m_btn_clear ("Clear") m_layout.addWidget(&m_leet_cb, 0, 2); #ifdef EOSIOKEYGEN_HAVE_THREADS - m_num_threads.setValue((int) eoskeygen::KeySearch::max_threads()); - m_num_threads.setRange(1, (int) eoskeygen::KeySearch::max_threads()); + m_num_threads.setValue((int) antelopekeygen::KeySearch::max_threads()); + m_num_threads.setRange(1, (int) antelopekeygen::KeySearch::max_threads()); m_num_threads.setSuffix(" Threads"); m_layout.addWidget(&m_num_threads, 0, 3); #endif /* EOSIOKEYGEN_HAVE_THREADS */ @@ -121,7 +121,7 @@ void SearchWindow::initSignals() void SearchWindow::loadDictionaries() { QStringList list; - eoskeygen::Dictionary tmpDict; + antelopekeygen::Dictionary tmpDict; std::string base_path(CONFIG_DICT_FULL_PATH); // Clear dictionary first. @@ -146,7 +146,7 @@ void SearchWindow::loadDictionaries() } } -void SearchWindow::onResult(const struct libantelope::ec_keypair* key, const struct eoskeygen::KeySearch::result& result) +void SearchWindow::onResult(const struct libantelope::ec_keypair* key, const struct antelopekeygen::KeySearch::result& result) { int pos = (int) result.pos; int len = (int) result.len; @@ -156,7 +156,7 @@ void SearchWindow::onResult(const struct libantelope::ec_keypair* key, const str QString mid = pub.mid(pos, len); QString left = pub.left(pos); QString right = pub.mid(pos + len, pub.size() - pos); - eoskeygen::Dictionary::search_result_t dict_res = m_dict.search(pub.toStdString()); + antelopekeygen::Dictionary::search_result_t dict_res = m_dict.search(pub.toStdString()); QString out = "Public: " + pub.left(pub_prefix_len); for(int i = pub_prefix_len; i < pub.length(); ) { @@ -198,12 +198,12 @@ void SearchWindow::search() } const std::string& input = m_txt_search.text().toLocal8Bit().constData(); - eoskeygen::strlist_t list; + antelopekeygen::strlist_t list; if (m_leet_cb.isChecked()) { - list = eoskeygen::l33twords(input); + list = antelopekeygen::l33twords(input); } else { - list = eoskeygen::strlist::splitw(input); + list = antelopekeygen::strlist::splitw(input); } // Validate that we atleast got something to search for. @@ -222,10 +222,10 @@ void SearchWindow::search() m_ksearch.setThreadCount(m_num_threads.value()); #endif /* EOSIOKEYGEN_HAVE_THREADS */ - QFuture future = QtConcurrent::run(&m_ksearch, &eoskeygen::KeySearch::find, m_num_results.value()); + QFuture future = QtConcurrent::run(&m_ksearch, &antelopekeygen::KeySearch::find, m_num_results.value()); m_worker.setFuture(future); - m_status.setText("Searching for: " + QString::fromStdString(eoskeygen::strlist::join(list, ", "))); + m_status.setText("Searching for: " + QString::fromStdString(antelopekeygen::strlist::join(list, ", "))); } void SearchWindow::output(const std::string& html) diff --git a/gui/src/SearchWindow.hpp b/gui/src/SearchWindow.hpp index 479edf2..9282ef4 100644 --- a/gui/src/SearchWindow.hpp +++ b/gui/src/SearchWindow.hpp @@ -37,13 +37,13 @@ #include #include "MultiSelect.hpp" -class SearchWindow : public QWidget, public eoskeygen::IKeySearchResult +class SearchWindow : public QWidget, public antelopekeygen::IKeySearchResult { Q_OBJECT public: explicit SearchWindow(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); - void onResult(const struct libantelope::ec_keypair* key, const struct eoskeygen::KeySearch::result& result); + void onResult(const struct libantelope::ec_keypair* key, const struct antelopekeygen::KeySearch::result& result); private : void initSignals(); @@ -76,9 +76,9 @@ private: // Search worker thread. QFutureWatcher m_worker; - eoskeygen::KeySearch m_ksearch; + antelopekeygen::KeySearch m_ksearch; - eoskeygen::Dictionary m_dict; + antelopekeygen::Dictionary m_dict; // Widgets // ----------------