#include <boost/uuid/name_generator.hpp>
#include <boost/uuid/nil_generator.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <iostream>
using namespace boost::uuids;
using namespace std;
int main()
{
{
cout << "WIDE" << endl;
const wchar_t* a = L"one long string that is something like this and that blahh";
const wchar_t* b = L"hello there you long long string that looks nothing like t";
nil_generator nil;
name_generator na(nil());
name_generator nb(nil());
uuid ua = na(a);
uuid ub = nb(b);
cout << to_string(ua) << endl;
cout << to_string(ub) << endl;
}
{
cout << "NARROW" << endl;
const char* a = "one long string that is something like this and that blahh";
const char* b = "hello there you long long string that looks nothing like t";
nil_generator nil;
name_generator na(nil());
name_generator nb(nil());
uuid ua = na(a);
uuid ub = nb(b);
cout << to_string(ua) << endl;
cout << to_string(ub) << endl;
}
return 0;
}
$ g++ main.cpp && ./a.out
WIDE
4ffa48af-9685-5089-97ac-fe6627ead94c
4ffa48af-9685-5089-97ac-fe6627ead94c
NARROW
73030b72-a864-5c7b-9963-c0bedff1283e
da8943a6-26c9-5641-bd37-427b1b70d619