/******************************************************************************** * Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIR_MQ_TOOLS_UNIQUE_H #define FAIR_MQ_TOOLS_UNIQUE_H #include #include #include #include #include namespace fair { namespace mq { namespace tools { // generates UUID string inline std::string Uuid() { boost::uuids::random_generator gen; boost::uuids::uuid u = gen(); return boost::uuids::to_string(u); } // generates UUID and returns its hash inline std::size_t UuidHash() { boost::uuids::random_generator gen; boost::hash uuid_hasher; boost::uuids::uuid u = gen(); return uuid_hasher(u); } } /* namespace tools */ } /* namespace mq */ } /* namespace fair */ #endif /* FAIR_MQ_TOOLS_UNIQUE_H */