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:
?- uuid(X). X = 'ea6589fa-19dd-11e2-8a49-001d92e1879d'. ?- uuid(X, [url('http://www.swi-prolog.org')]). X = '73a07870-6a90-3f2e-ae2b-ffa538dc7c2c'.
uuid(UUID, [])
. See uuid/2 for options.atom
, yielding atoms
such as 8304efdd-bd6e-5b7c-a27f-83f3f05c64e0
. 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 version(4)
and format(Format)
.
-
at the right place
and all other characters are hexadecimal.