mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-10 04:44:36 +00:00
Cleanup
This commit is contained in:
parent
11da7a3155
commit
3055e03b7e
5 changed files with 33 additions and 12 deletions
|
@ -160,11 +160,11 @@ static void print_threads(Config *config)
|
|||
static void print_commands(Config *)
|
||||
{
|
||||
if (Log::isColors()) {
|
||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("COMMANDS ") MAGENTA_BG(WHITE_BOLD_S "h") WHITE_BOLD("ashrate, ")
|
||||
MAGENTA_BG(WHITE_BOLD_S "p") WHITE_BOLD("ause, ")
|
||||
MAGENTA_BG(WHITE_BOLD_S "r") WHITE_BOLD("esume, ")
|
||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("COMMANDS ") MAGENTA_BG_BOLD("h") WHITE_BOLD("ashrate, ")
|
||||
MAGENTA_BG_BOLD("p") WHITE_BOLD("ause, ")
|
||||
MAGENTA_BG_BOLD("r") WHITE_BOLD("esume, ")
|
||||
WHITE_BOLD("re") MAGENTA_BG(WHITE_BOLD_S "s") WHITE_BOLD("ults, ")
|
||||
MAGENTA_BG(WHITE_BOLD_S "c") WHITE_BOLD("onnection")
|
||||
MAGENTA_BG_BOLD("c") WHITE_BOLD("onnection")
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* XMRig
|
||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <support@xmrig.com>
|
||||
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2020 XMRig <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -28,6 +28,12 @@ using uv_handle_t = struct uv_handle_s;
|
|||
using uv_stream_t = struct uv_stream_s;
|
||||
using uv_tty_t = struct uv_tty_s;
|
||||
|
||||
#ifdef XMRIG_OS_WIN
|
||||
using ssize_t = intptr_t;
|
||||
#else
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
|
|
@ -237,6 +237,24 @@ xmrig::Buffer xmrig::Cvt::randomBytes(const size_t size)
|
|||
}
|
||||
|
||||
|
||||
rapidjson::Value xmrig::Cvt::toHex(const Buffer &data, rapidjson::Document &doc)
|
||||
{
|
||||
return toHex(data.data(), data.size(), doc);
|
||||
}
|
||||
|
||||
|
||||
rapidjson::Value xmrig::Cvt::toHex(const std::string &data, rapidjson::Document &doc)
|
||||
{
|
||||
return toHex(reinterpret_cast<const uint8_t *>(data.data()), data.size(), doc);
|
||||
}
|
||||
|
||||
|
||||
rapidjson::Value xmrig::Cvt::toHex(const uint8_t *in, size_t size, rapidjson::Document &doc)
|
||||
{
|
||||
return toHex(in, size).toJSON(doc);
|
||||
}
|
||||
|
||||
|
||||
xmrig::String xmrig::Cvt::toHex(const uint8_t *in, size_t size)
|
||||
{
|
||||
assert(in != nullptr && size > 0);
|
||||
|
|
|
@ -48,6 +48,9 @@ public:
|
|||
static bool toHex(char *hex, size_t hex_maxlen, const uint8_t *bin, size_t bin_len);
|
||||
static Buffer fromHex(const char *in, size_t size);
|
||||
static Buffer randomBytes(size_t size);
|
||||
static rapidjson::Value toHex(const Buffer &data, rapidjson::Document &doc);
|
||||
static rapidjson::Value toHex(const std::string &data, rapidjson::Document &doc);
|
||||
static rapidjson::Value toHex(const uint8_t *in, size_t size, rapidjson::Document &doc);
|
||||
static String toHex(const uint8_t *in, size_t size);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue