UUID is a Common Lisp librabry for generation of universally unique identifiers as described by RFC 4122.
UUID provides methods for the generation of uuids version 1 (time based), 3 (name based with MD5 hashing), 5 (name based with SHA1 hashing) and 4 (random uuids).
UUID has been run on Clisp (Windows), CMUCL(19d), SBCL(1.0.5 - Linux) and Allegro (Linux). Plattform specific code is needed only for the generation of time based (version 1) uuids for getting the MAC address of an ethernet device. If run in an unsupported lisp implementation a random number will be used for the node id instead of the MAC address.
26 May 2009 - Added suport for Allegron on Linux (Contributed by Andrew Philpot). Added suport for formatting as URN (Thanks to Kim Minh Kaplan).
27 July 2008 - Resolve loading issue due to Ironclad shadowing cl:null. (Reported by Maciek Pasternacki)
20 January 2008 - Fixed uuid-to-byte-array and provided byte-array-to-uuid.
02 October 2007 - Don't print a newline as part of the uuid.
07 July 2007 - Reinitialize *random-state* when loading in SBCL to ensure randomnes of v4 uuids. (Reported by Brian Seitz)
30 May 2007 - Added support for SBCL.
17 April 2007 - Updated the package with the correct file. (Reported by Rafael Cavallaro)
16 April 2007 - Released
Ironclad - needed for the generation of version 3 and version 5 uuids.
Lisp Lesser GNU Public License (LLGPL)
Boian Tzonev <firstname.lastname@example.org>
UUID can be loaded with asdf. After unpacking the archive UUID can be loaded with:
Generation of version 1 (time based) uuid:
Generation of version 3 (name based MD5) uuid in the DNS namespace:
Generation of version 4 (random) uuid:
Generation of version 5 (name based SHA1) uuid in the DNS namespace:
Holds the amount of ticks per count. The ticks per count determine the number of possible version 1 uuids created for one time interval. Common Lisp provides INTERNAL-TIME-UINITS-PER-SECOND which gives the ticks per count for the current system so *ticks-per-count* can be set to INTERNAL-TIME-UINITS-PER-SECOND
The DNS Namespace. Can be used for the generation of uuids version 3 and 5.
The URL Namespace. Can be used for the generation of uuids version 3 and 5.
The OID Namespace. Can be used for the generation of uuids version 3 and 5.
The x500+ Namespace. Can be used for the generation of uuids version 3 and 5.
Represents an uuid
(make-uuid-from-string uuid-string) function
Creates an uuid from the string represenation of an uuid. (example input string 6ba7b810-9dad-11d1-80b4-00c04fd430c8)
Returns a NULL uuid (i.e 00000000-0000-0000-0000-000000000000)
Returns a version 1 (time-based) uuid.
(make-v3-uuid namespace name) function
Returns a version 3 (named based MD5) uuid.
Returns a version 4 (random) uuid.
(make-v5-uuid namespace name) function
Returns a version 5 (name based SHA1) uuid.
(uuid-to-byte-array uuid) function
Converts an uuid to byte-array.
(byte-array-to-uuid byte-array) function
Converts a byte-array generated with uuid-to-byte-array to an uuid.
(print-bytes stream uuid) function
Prints the raw bytes in hex form. (example output 6ba7b8109dad11d180b400c04fd430c8).
(format-as-urn stream uuid) function
Formats the UUID as URN (example output urn:uuid:ea0e0cb8-7ed8-4b10-8214-1a175e982cc6).
Last modified: Tue May 26 23:05:54 EEST 2009