add lokinet_hex_to_base32z

pull/1748/head
Jeff Becker 3 years ago committed by Jeff
parent d3d07fe53e
commit 1c70b0f42f

@ -21,6 +21,11 @@ extern "C"
int EXPORT
lokinet_log_level(const char*);
/// @brief take in hex and turn it into base32z
/// @return value must be free()'d later
char* EXPORT
lokinet_hex_to_base32z(const char* hex);
#ifdef __cplusplus
}
#endif

@ -12,6 +12,8 @@
#include <llarp/util/logging/buffer.hpp>
#include <oxenmq/base32z.h>
#include <mutex>
#ifdef _WIN32
@ -546,6 +548,13 @@ extern "C"
return id;
}
char* EXPORT
lokinet_hex_to_base32z(const char* hex)
{
const auto base32z = oxenmq::to_base32z(oxenmq::from_hex(std::string{hex}));
return strdup(base32z.c_str());
}
void EXPORT
lokinet_close_stream(int stream_id, struct lokinet_context* ctx)
{

Loading…
Cancel
Save