mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-06-16 03:44:56 +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
|
|
@ -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 <henrik@eossweden.org>")
|
||||
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 )
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
|
||||

|
||||
[](https://github.com/eosswedenorg/eosio-keygen/releases/latest)
|
||||

|
||||
[](https://github.com/eosswedenorg/antelope-keygen/releases/latest)
|
||||
[](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
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 <string>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
class Dictionary
|
||||
{
|
||||
|
|
@ -70,6 +70,6 @@ protected :
|
|||
std::set<std::string> m_words;
|
||||
};
|
||||
|
||||
} // namespace eoskeygen
|
||||
} // namespace antelopekeygen
|
||||
|
||||
#endif /* EOSIOKEYGEN_COMMON_CORE_DICTIONARY_H */
|
||||
#endif /* ANTELOPEKEYGEN_COMMON_CORE_DICTIONARY_H */
|
||||
|
|
|
|||
|
|
@ -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 <eoskeygen/core/strlist.hpp>
|
||||
|
||||
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 */
|
||||
|
|
|
|||
|
|
@ -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 <string>
|
||||
#include <eoskeygen/core/strlist.hpp>
|
||||
|
||||
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 */
|
||||
|
|
|
|||
|
|
@ -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 <vector>
|
||||
#include <string>
|
||||
|
||||
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 */
|
||||
|
|
|
|||
|
|
@ -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 <vector>
|
||||
#include <string>
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
typedef std::vector<std::string> 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 */
|
||||
|
|
|
|||
|
|
@ -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 <stdint.h>
|
||||
#include <string>
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#include <eoskeygen/core/dictionary.hpp>
|
||||
#include <eoskeygen/core/strlist.hpp>
|
||||
|
||||
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 <result>), 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 */
|
||||
|
|
|
|||
|
|
@ -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 <eoskeygen/key_search.hpp>
|
||||
|
||||
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 */
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include <eoskeygen/core/dictionary.hpp>
|
||||
#include <eoskeygen/core/file.hpp>
|
||||
|
||||
namespace eoskeygen {
|
||||
namespace antelopekeygen {
|
||||
|
||||
struct StringContains {
|
||||
StringContains(const std::string& str, std::vector<size_t>& 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
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include <eoskeygen/core/string.hpp>
|
||||
#include <eoskeygen/core/file.hpp>
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include <algorithm>
|
||||
#include <eoskeygen/core/leet.hpp>
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#include <algorithm>
|
||||
#include <eoskeygen/core/string.hpp>
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include <eoskeygen/core/string.hpp>
|
||||
#include <eoskeygen/core/strlist.hpp>
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include <eoskeygen/key_search_result.hpp>
|
||||
#include <eoskeygen/key_search.hpp>
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include <eoskeygen/key_search_result.hpp>
|
||||
#include <eoskeygen/key_search.hpp>
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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<void> future = QtConcurrent::run(&m_ksearch, &eoskeygen::KeySearch::find, m_num_results.value());
|
||||
QFuture<void> 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)
|
||||
|
|
|
|||
|
|
@ -37,13 +37,13 @@
|
|||
#include <eoskeygen/key_search.hpp>
|
||||
#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<void> m_worker;
|
||||
|
||||
eoskeygen::KeySearch m_ksearch;
|
||||
antelopekeygen::KeySearch m_ksearch;
|
||||
|
||||
eoskeygen::Dictionary m_dict;
|
||||
antelopekeygen::Dictionary m_dict;
|
||||
|
||||
// Widgets
|
||||
// ----------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue