mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-06-17 14:12:25 +00:00
add uuid source files
were missed last commit related to uuids
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace uuid {
|
||||||
|
|
||||||
|
std::string GenerateUuid();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include "Uuid.h"
|
||||||
|
|
||||||
|
#include <boost/uuid/random_generator.hpp>
|
||||||
|
#include <boost/uuid/uuid.hpp>
|
||||||
|
#include <boost/uuid/uuid_generators.hpp>
|
||||||
|
#include <boost/uuid/uuid_io.hpp>
|
||||||
|
#include <fmt/format.h>
|
||||||
|
#include <fmt/ostream.h>
|
||||||
|
|
||||||
|
std::string uuid::GenerateUuid() {
|
||||||
|
static thread_local boost::uuids::random_generator Generator {};
|
||||||
|
boost::uuids::uuid Id { Generator() };
|
||||||
|
return boost::uuids::to_string(Id);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user