% This LaTeX document was generated using the LaTeX backend of PlDoc,
% The SWI-Prolog documentation system



\section{library(uuid): Universally Unique Identifier (UUID) Library}

\label{sec:uuid}

\begin{tags}
    \tag{See also}
\url{http://www.ossp.org/pkg/lib/uuid/}
    \tag{To be done}
Compare UUIDs, extract time and version from UUIDs
\end{tags}

The library provides operations on UUIDs. Please consult other sources
for understanding UUIDs and the implications of the different UUID
versions. Some typical calls are given below:

\begin{code}
?- uuid(X).
X = 'ea6589fa-19dd-11e2-8a49-001d92e1879d'.

?- uuid(X, [url('http://www.swi-prolog.org')]).
X = '73a07870-6a90-3f2e-ae2b-ffa538dc7c2c'.
\end{code}

\vspace{0.7cm}

\begin{description}
    \predicate[det]{uuid}{1}{-UUID}
\arg{UUID} is an atom representing a new \arg{UUID}. This is the same as
calling \verb$uuid(UUID, [])$. See \predref{uuid}{2} for options.

    \predicate[det]{uuid}{2}{-UUID, +Options}
Create a new \arg{UUID} according to \arg{Options}. The following options
are defined:

\begin{description}
    \termitem{version}{+Versions}
Integer in the range 1..5, which specifies the \arg{UUID} version
that is created. Default is 1.
    \termitem{dns}{DNS}
    \termitem{url}{URL}
    \termitem{oid}{OID}
    \termitem{x500}{X500}
Provide additional context information for UUIDs using version
3 or 5. If there is no explicit version option, \arg{UUID} version
3 is used.
    \termitem{format}{+Format}
Representation of the \arg{UUID}. Default is \const{atom}, yielding atoms
such as \verb$8304efdd-bd6e-5b7c-a27f-83f3f05c64e0$. The
alternative is \const{integer}, returning a large integer that
represents the 128 bits of the \arg{UUID}.
\end{description}
\end{description}

