- See also
- - http://www.ossp.org/pkg/lib/uuid/
- To be done
- Compare UUIDs, extract time and version from UUIDs
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:
X = 'ea6589fa-19dd-11e2-8a49-001d92e1879d'.
?- uuid(X, [url('http://www.swi-prolog.org')]).
X = '73a07870-6a90-3f2e-ae2b-ffa538dc7c2c'.
- UUID is an atom representing a new UUID. This is
the same as calling
uuid(UUID, ). See uuid/2
- Create a new UUID according to Options. The
following options are defined:
- Integer in the range 1..5, which specifies the UUID version
that is created. Default is 1.
- Provide additional context information for UUIDs using version 3 or 5.
If there is no explicit version option, UUID version 3 is
- Representation of the UUID. Default is
yielding atoms such as
The alternative is
integer, returning a large integer that
represents the 128 bits of the UUID.
If SWI-Prolog was not built with the OSSP UUID dependency
library a simple Prolog alternative that only implements version 4
random UUIDs is provided. In this case the default version is 4 and the
only admissible options are
- True when UUID is a property of the given UUID.
Supported properties are:
- Return the version of the UUID (1..5)
- Time using SWI-Prolog's time stamp (float with seconds since January 1,
1970, UTC). Only for version 1 and 2 UUIDs
- To be done
- Implement more properties.