|Did you know ...||Search Documentation:|
|Packs (add-ons) for SWI-Prolog|
|Title:||Generating and parsing version 4 UUIDs in Pure Prolog|
|Rating:||Not rated. Create the first rating!|
|Author:||James N. V. Cash <firstname.lastname@example.org>|
No reviews. Create the first review!.
This library provides predicates for dealing with UUIDs in Prolog.
There is supposed to be a
uuid library already provided, but it seems not to be provided in my distribution and seems to not be able to parse a uuid from a given string.
Also, because the initial purpose of this library is to communicate via Transit, I wanted the canonical representation of the UUIDs to be two 64-bit signed integers (as that's how they're represented in Transit+MsgPack, which is what Braid uses).
If neither of those things are important to you, you may as well use the one that comes with SWI-Prolog.
It can be installed in SWI-Prolog using
?- random_uuid(UUID), uuid_atom(UUID, Atom). UUID = uuid(7100215486400447724, 1339227574425780922), Atom = '6289085d-c7a0-44ec-1295-e462270e82ba'.
?- uuid_atom(UUID, '9b5ee764-c1a2-4b23-9ed5-ca8644863c79'). UUID = uuid(-7251103930088535261, -7001467367653491591).
Pack contains 4 files holding a total of 5.2K bytes.