mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Improve UUID handling
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
This commit is contained in:
parent
2103e4b05f
commit
ac67044222
4 changed files with 12 additions and 2 deletions
|
@ -18,7 +18,6 @@
|
|||
#include <sys/types.h>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <uuid/uuid.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <villas/common.hpp>
|
||||
|
|
|
@ -13,9 +13,14 @@
|
|||
#include <jansson.h>
|
||||
#include <uuid/uuid.h>
|
||||
|
||||
typedef char uuid_string_t[37];
|
||||
|
||||
namespace villas {
|
||||
namespace uuid {
|
||||
|
||||
// Convert a UUID to C++ string
|
||||
std::string toString(uuid_t in);
|
||||
|
||||
// Generate an UUID by MD5 hashing the provided string
|
||||
int generateFromString(uuid_t out, const std::string &data, const std::string &ns = "");
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <openssl/buffer.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <jansson.h>
|
||||
#include <uuid/uuid.h>
|
||||
|
||||
#include <villas/config.hpp>
|
||||
#include <villas/utils.hpp>
|
||||
|
|
|
@ -11,6 +11,13 @@
|
|||
|
||||
using namespace villas::uuid;
|
||||
|
||||
std::string villas::uuid::toString(const uuid_t in)
|
||||
{
|
||||
uuid_string_t str;
|
||||
uuid_unparse_lower(in, str);
|
||||
return str;
|
||||
}
|
||||
|
||||
int villas::uuid::generateFromString(uuid_t out, const std::string &data, const std::string &ns)
|
||||
{
|
||||
int ret;
|
||||
|
|
Loading…
Add table
Reference in a new issue