This is a UUID library for implemented in C++ and can be used by downloading this repository and copy uuid.h
file to your project and include it in your project like
#include "uuid.h"
You can use this library to generate uuid libraries as follows.
// main.cpp
#include <iostream>
#include "uuid.h" // Path to the library
using namespace std;
int main()
{
uuid::UUID uuid1;
cout << uuid1.generate();
return (0);
}
-
namespace uuid
-> Namespace-
It includes two classes
RandomHexGenerator
utility class to generate hex value. AndUUID
Main class for UUID generation.-
RandomHexGenerator
-> Class- Method:
string generate()
-> Usage:- Generates a random hex of length 5
int main() { uuid::RandomHexGenerator random_generator; std::cout << random_generator.generate() }
- Method:
-
UUID
-> Class- Method:
string generate()
-> Usage:- Generate a random UUID
int main() { uuid::UUID uuid; std::cout << uuid.generate(); }
- Method:
-
-