mirror of
https://github.com/xmrig/xmrig.git
synced 2026-01-31 01:22:53 -05:00
Cleanup
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user