Boost.Uuid, part of Boost C++ Libraries, provides a C++ implementation of Universally Unique Identifiers (UUID) as described in RFC 4122 and RFC 9562.
See the documentation for more information.
Distributed under the Boost Software License, Version 1.0.
| Branch | Github Actions | Appveyor | Dependencies | Documentation | Test Matrix |
|---|---|---|---|---|---|
master |
|||||
develop |
[uuid] tag at the beginning of the subject line.// mkuuid.cpp example
#include <boost/uuid.hpp>
#include <iostream>
int main()
{
boost::uuids::random_generator gen;
std::cout << gen() << std::endl;
}
$ clang++ -Wall -Wextra -std=c++11 -O2 mkuuid.cpp -o mkuuid
$ ./mkuuid
2c186eb0-89cf-4a3c-9b97-86db1670d5f4
$ ./mkuuid
a9d3fbb9-0383-4389-a8a8-61f6629f90b6
<h1>Boost.Uuid</h1> <p>Boost.Uuid, part of <a href="http://boost.org">Boost C++ Libraries</a>, provides a C++ implementation of Universally Unique Identifiers (UUID) as described in <a href="https://datatracker.ietf.org/doc/rfc4122/">RFC 4122</a> and <a href="https://datatracker.ietf.org/doc/rfc9562/">RFC 9562</a>.</p> <p>See <a href="http://boost.org/libs/uuid">the documentation</a> for more information.</p> <h2>License</h2> <p>Distributed under the <a href="https://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</p> <h2>Properties</h2> <ul> <li>C++11 (since Boost 1.86.0)</li> <li>Header-only</li> </ul> <h2>Current Status</h2> <table> <thead> <tr> <th align="center">Branch</th> <th align="left">Github Actions</th> <th align="left">Appveyor</th> <th align="left">Dependencies</th> <th align="left">Documentation</th> <th align="left">Test Matrix</th> </tr> </thead> <tbody> <tr> <td align="center"><a href="https://github.com/boostorg/uuid/tree/master"><code>master</code></a></td> <td align="left"><a href="https://github.com/boostorg/uuid/actions?query=branch:master"><img src="https://github.com/boostorg/uuid/actions/workflows/ci.yml/badge.svg?branch=master" alt="Build Status" /></a></td> <td align="left"><a href="https://ci.appveyor.com/project/cppalliance/uuid/branch/master"><img src="https://ci.appveyor.com/api/projects/status/rmp9xmse2b6urkjv/branch/master?svg=true" alt="Build status" /></a></td> <td align="left"><a href="https://pdimov.github.io/boostdep-report/master/uuid.html"><img src="https://img.shields.io/badge/deps-master-brightgreen.svg" alt="Deps" /></a></td> <td align="left"><a href="http://www.boost.org/doc/libs/master/doc/html/uuid.html"><img src="https://img.shields.io/badge/docs-master-brightgreen.svg" alt="Documentation" /></a></td> <td align="left"><a href="https://regression.boost.io/master/developer/uuid.html"><img src="https://img.shields.io/badge/matrix-master-brightgreen.svg" alt="Enter the Matrix" /></a></td> </tr> <tr> <td align="center"><a href="https://github.com/boostorg/uuid/tree/develop"><code>develop</code></a></td> <td align="left"><a href="https://github.com/boostorg/uuid/actions?query=branch:develop"><img src="https://github.com/boostorg/uuid/actions/workflows/ci.yml/badge.svg?branch=develop" alt="Build Status" /></a></td> <td align="left"><a href="https://ci.appveyor.com/project/cppalliance/uuid/branch/develop"><img src="https://ci.appveyor.com/api/projects/status/rmp9xmse2b6urkjv/branch/develop?svg=true" alt="Build status" /></a></td> <td align="left"><a href="https://pdimov.github.io/boostdep-report/develop/uuid.html"><img src="https://img.shields.io/badge/deps-develop-brightgreen.svg" alt="Deps" /></a></td> <td align="left"><a href="http://www.boost.org/doc/libs/develop/doc/html/uuid.html"><img src="https://img.shields.io/badge/docs-develop-brightgreen.svg" alt="Documentation" /></a></td> <td align="left"><a href="https://regression.boost.io/develop/developer/uuid.html"><img src="https://img.shields.io/badge/matrix-develop-brightgreen.svg" alt="Enter the Matrix" /></a></td> </tr> </tbody> </table> <h2>More Information</h2> <ul> <li><a href="http://stackoverflow.com/questions/ask?tags=c%2B%2B,boost,boost-uuid">Ask questions</a></li> <li><a href="https://github.com/boostorg/uuid/issues">Report bugs</a>: Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.</li> <li>Submit your patches as pull requests against the <strong>develop</strong> branch. Note that by submitting patches you agree to license your modifications under the <a href="https://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</li> <li>Discussions about the library are held on the <a href="http://www.boost.org/community/groups.html#main">Boost developers mailing list</a>. Be sure to read the <a href="http://www.boost.org/community/policy.html">discussion policy</a> before posting and add the <code>[uuid]</code> tag at the beginning of the subject line.</li> </ul> <h2>Code Example - UUID Generation</h2> <pre class="highlightjs highlight"><code class="language-cpp hljs">// mkuuid.cpp example #include <boost/uuid.hpp> #include <iostream> int main() { boost::uuids::random_generator gen; std::cout << gen() << std::endl; } </code></pre> <pre class="highlightjs highlight"><code class="language-shell hljs">$ clang++ -Wall -Wextra -std=c++11 -O2 mkuuid.cpp -o mkuuid $ ./mkuuid 2c186eb0-89cf-4a3c-9b97-86db1670d5f4 $ ./mkuuid a9d3fbb9-0383-4389-a8a8-61f6629f90b6 </code></pre>
<h1>Boost.Uuid</h1> <p>Boost.Uuid, part of <a href="http://boost.org">Boost C++ Libraries</a>, provides a C++ implementation of Universally Unique Identifiers (UUID) as described in <a href="https://datatracker.ietf.org/doc/rfc4122/">RFC 4122</a> and <a href="https://datatracker.ietf.org/doc/rfc9562/">RFC 9562</a>.</p> <p>See <a href="http://boost.org/libs/uuid">the documentation</a> for more information.</p> <h2>License</h2> <p>Distributed under the <a href="https://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</p> <h2>Properties</h2> <ul> <li>C++11 (since Boost 1.86.0)</li> <li>Header-only</li> </ul> <h2>Current Status</h2> <table> <thead> <tr> <th align="center">Branch</th> <th align="left">Github Actions</th> <th align="left">Appveyor</th> <th align="left">Dependencies</th> <th align="left">Documentation</th> <th align="left">Test Matrix</th> </tr> </thead> <tbody> <tr> <td align="center"><a href="https://github.com/boostorg/uuid/tree/master"><code>master</code></a></td> <td align="left"><a href="https://github.com/boostorg/uuid/actions?query=branch:master"><img src="https://github.com/boostorg/uuid/actions/workflows/ci.yml/badge.svg?branch=master" alt="Build Status" /></a></td> <td align="left"><a href="https://ci.appveyor.com/project/cppalliance/uuid/branch/master"><img src="https://ci.appveyor.com/api/projects/status/rmp9xmse2b6urkjv/branch/master?svg=true" alt="Build status" /></a></td> <td align="left"><a href="https://pdimov.github.io/boostdep-report/master/uuid.html"><img src="https://img.shields.io/badge/deps-master-brightgreen.svg" alt="Deps" /></a></td> <td align="left"><a href="http://www.boost.org/doc/libs/master/doc/html/uuid.html"><img src="https://img.shields.io/badge/docs-master-brightgreen.svg" alt="Documentation" /></a></td> <td align="left"><a href="https://regression.boost.io/master/developer/uuid.html"><img src="https://img.shields.io/badge/matrix-master-brightgreen.svg" alt="Enter the Matrix" /></a></td> </tr> <tr> <td align="center"><a href="https://github.com/boostorg/uuid/tree/develop"><code>develop</code></a></td> <td align="left"><a href="https://github.com/boostorg/uuid/actions?query=branch:develop"><img src="https://github.com/boostorg/uuid/actions/workflows/ci.yml/badge.svg?branch=develop" alt="Build Status" /></a></td> <td align="left"><a href="https://ci.appveyor.com/project/cppalliance/uuid/branch/develop"><img src="https://ci.appveyor.com/api/projects/status/rmp9xmse2b6urkjv/branch/develop?svg=true" alt="Build status" /></a></td> <td align="left"><a href="https://pdimov.github.io/boostdep-report/develop/uuid.html"><img src="https://img.shields.io/badge/deps-develop-brightgreen.svg" alt="Deps" /></a></td> <td align="left"><a href="http://www.boost.org/doc/libs/develop/doc/html/uuid.html"><img src="https://img.shields.io/badge/docs-develop-brightgreen.svg" alt="Documentation" /></a></td> <td align="left"><a href="https://regression.boost.io/develop/developer/uuid.html"><img src="https://img.shields.io/badge/matrix-develop-brightgreen.svg" alt="Enter the Matrix" /></a></td> </tr> </tbody> </table> <h2>More Information</h2> <ul> <li><a href="http://stackoverflow.com/questions/ask?tags=c%2B%2B,boost,boost-uuid">Ask questions</a></li> <li><a href="https://github.com/boostorg/uuid/issues">Report bugs</a>: Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.</li> <li>Submit your patches as pull requests against the <strong>develop</strong> branch. Note that by submitting patches you agree to license your modifications under the <a href="https://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</li> <li>Discussions about the library are held on the <a href="http://www.boost.org/community/groups.html#main">Boost developers mailing list</a>. Be sure to read the <a href="http://www.boost.org/community/policy.html">discussion policy</a> before posting and add the <code>[uuid]</code> tag at the beginning of the subject line.</li> </ul> <h2>Code Example - UUID Generation</h2> <pre class="highlightjs highlight"><code class="language-cpp hljs">// mkuuid.cpp example #include <boost/uuid.hpp> #include <iostream> int main() { boost::uuids::random_generator gen; std::cout << gen() << std::endl; } </code></pre> <pre class="highlightjs highlight"><code class="language-shell hljs">$ clang++ -Wall -Wextra -std=c++11 -O2 mkuuid.cpp -o mkuuid $ ./mkuuid 2c186eb0-89cf-4a3c-9b97-86db1670d5f4 $ ./mkuuid a9d3fbb9-0383-4389-a8a8-61f6629f90b6 </code></pre>