Common Lisp Package: UUID

README:

FUNCTION

Public

BYTE-ARRAY-TO-UUID (ARRAY)

Converts a byte-array generated with uuid-to-byte-array to an uuid.

MAKE-NULL-UUID

Generates a NULL uuid (i.e 00000000-0000-0000-0000-000000000000)

MAKE-UUID-FROM-STRING (STRING)

Creates an uuid from the string represenation of an uuid. (example input string 6ba7b810-9dad-11d1-80b4-00c04fd430c8)

MAKE-V1-UUID

Generates a version 1 (time-based) uuid.

MAKE-V3-UUID (NAMESPACE NAME)

Generates a version 3 (named based MD5) uuid.

MAKE-V4-UUID

Generates a version 4 (random) uuid

MAKE-V5-UUID (NAMESPACE NAME)

Generates a version 5 (name based SHA1) uuid.

UUID-TO-BYTE-ARRAY (UUID)

Converts an uuid to byte-array

Undocumented

UUID= (UUID1 UUID2)

Private

DIGEST-UUID (DIGEST UUID NAME)

Helper function that produces a digest from a namespace (a byte array) and a string. Used for the generation of version 3 and 5 uuids.

FORMAT-AS-URN (STREAM UUID)

Prints the uuid as a urn

FORMAT-V3OR5-UUID (HASH VER)

Helper function to format a version 3 or 5 uuid. Formatting means setting the appropriate version bytes.

GET-NODE-ID

Get MAC address of first ethernet device

GET-TIMESTAMP

Get timestamp, compensate nanoseconds intervals

MACRO

Private

ARR-TO-BYTES (FROM TO ARRAY)

Helper macro used in byte-array-to-uuid.

SLOT-ACCESSOR

Private

Undocumented

CLOCK-SEQ-LOW (OBJECT)

SETFCLOCK-SEQ-LOW (NEW-VALUE OBJECT)

CLOCK-SEQ-VAR (OBJECT)

SETFCLOCK-SEQ-VAR (NEW-VALUE OBJECT)

NODE (OBJECT)

SETFNODE (NEW-VALUE OBJECT)

TIME-HIGH (OBJECT)

SETFTIME-HIGH (NEW-VALUE OBJECT)

TIME-LOW (OBJECT)

SETFTIME-LOW (NEW-VALUE OBJECT)

TIME-MID (OBJECT)

SETFTIME-MID (NEW-VALUE OBJECT)

VARIABLE

Public

*TICKS-PER-COUNT*

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-UNITS-PER-SECOND which gives the ticks per count for the current system so *ticks-per-count* can be set to INTERNAL-TIME-UNITS-PER-SECOND

+NAMESPACE-DNS+

The DNS Namespace. Can be used for the generation of uuids version 3 and 5

+NAMESPACE-OID+

The OID Namespace. Can be used for the generation of uuids version 3 and 5

+NAMESPACE-URL+

The URL Namespace. Can be used for the generation of uuids version 3 and 5

+NAMESPACE-X500+

The x500+ Namespace. Can be used for the generation of uuids version 3 and 5

Private

*CLOCK-SEQ*

Holds the clock sequence. It is set when a version 1 uuid is generated for the first time and remains unchanged during a whole session.

*NODE*

Holds the IEEE 802 MAC address or a random number when such is not available

*UUID-RANDOM-STATE*

Holds the random state used for generation of random numbers

CLASS

Public

UUID

Represents an uuid