fork download
  1. #include <boost/uuid/uuid.hpp>
  2. #include <boost/uuid/uuid_generators.hpp>
  3. #include <boost/uuid/uuid_io.hpp>
  4. #include <iostream>
  5.  
  6. int main() {
  7. // This is a random UUID which we'll use as a namespace.
  8. auto base_uuid = boost::uuids::nil_generator()();
  9.  
  10. // This is our name.
  11. std::string name = "276009010828";
  12.  
  13. // Generate a UUID based on the DNS namespace and our name.
  14. boost::uuids::name_generator name_gen(base_uuid);
  15. boost::uuids::uuid u = name_gen(name);
  16.  
  17. std::cout << u << std::endl;
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
d408df3e-c11c-541e-ae92-d8b3fc104978