Cleanup
This commit is contained in:
parent
11da7a3155
commit
3055e03b7e
5 changed files with 33 additions and 12 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue