Common Lisp Package: UNICLY

README:

FUNCTION

Public

MAKE-HASH-TABLE-UUID (&KEY (SIZE +MIN-HASH-TABLE-SIZE+) (REHASH-SIZE 1.5) (REHASH-THRESHOLD 1) (WEAKNESS NIL) (SYNCHRONIZED NIL))

Return a hash-table specialized to hold UUIDs as keys. On SBCL this this is a hash-table with `uuid-eql' as `cl:hash-table-test'. Keyword :SYNCHRONIZED when non-nile indicates hash-table may have multiple concurrent readers. :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `sb-ext:with-locked-hash-table'.

MAKE-NULL-UUID

Generate a NULL UUID. Per RFC4122 Setion 4.1.7. "Nil UUID": The nil UUID is special form of UUID specified to have all 128 bits set to zero. Return value is an instance of `unique-universal-identifier' with all slots defaulted to 0. Return value has the format: 00000000-0000-0000-0000-000000000000 :EXAMPLE (make-null-uuid) :NOTE Two null-uuids do not share identity: (eq (make-instance 'unique-universal-identifier) (make-instance 'unique-universal-identifier)) (eql (make-instance 'unique-universal-identifier) (make-instance 'unique-universal-identifier)) (equal (make-instance 'unique-universal-identifier) (make-instance 'unique-universal-identifier)) (equalp (make-instance 'unique-universal-identifier) (make-instance 'unique-universal-identifier)) However, we can test with `uuid-eql' if they have the same representation in uuid-bit-vector-128 format: (uuid-eql (make-instance 'unique-universal-identifier) (make-instance 'unique-universal-identifier)) :SEE-ALSO `uuid-bit-vector-128-zeroed'.

MAKE-UUID-FROM-STRING (UUID-OR-HEX-STRING-36)

Create an instance of class UNIQUE-UNIVERSAL-IDENTIFIER from UUID-OR-HEX-STRING-36. UUID-OR-HEX-STRING-36 is an object of type UNIQUE-UNIVERSAL-IDENTIFIER or UUID-OR-HEX-STRING-36. It should satisfy one of `unique-universal-identifier-p' or `uuid-hex-string-36-p', an error is signaled if not. :EXAMPLE (make-uuid-from-string "6ba7b810-9dad-11d1-80b4-00c04fd430c8") (make-uuid-from-string *uuid-namespace-dns*) (make-uuid-from-string (uuid-princ-to-string *uuid-namespace-dns*)) (equal (make-uuid-from-string *uuid-namespace-dns*) (make-uuid-from-string (uuid-princ-to-string *uuid-namespace-dns*))) ;; :Following successfully signals an error: (make-uuid-from-string "Q6ba7b810-9dad-11d1-80b4-00c04fd430c8") :SEE-ALSO `<XREF>'.

MAKE-V3-UUID (NAMESPACE NAME)

Generate an RFC4122 version 3 (named based MD5) UUID for NAME in NAMESPACE. Return value is an instance of the UNIQUE-UNIVERSAL-IDENTIFIER class. NAMESPACE is a UUID namespace object. NAME is a string. :EXAMPLE (make-v3-uuid *uuid-namespace-dns* "bubba") :SEE-ALSO `<XREF>'.

MAKE-V4-UUID

Return a version 4 (random) UUID. Return value is an instance of the UNIQUE-UNIVERSAL-IDENTIFIER class. :EXAMPLE { ... <EXAMPLE> ... } A v4 UUID is one generatied UUIDs from truly-random or pseudo-random numbers. ,---- RFC4122 Section 4.4. "Creating UUIDs from Truly-Random/Pseudo-Random Numbers" | | The algorithm is as follows: | | 1) Set the two most significant bits (bits 6 and 7) of the | clock_seq_hi_and_reserved to zero and one, respectively. | `-> Slot `%uuid_clock-seq-and-reserved' | :NOTE Steps 7 and 8 for v3 and v5 with `%uuid_clock-seq-and-reserved-request' | | 2) Set the four most significant bits (bits 12 through 15) of the | time_hi_and_version field to the 4-bit version number from Section 4.1.3. | `-> Slot `%uuid_time-high-and-version' e.g. #*0100 | :NOTE Correspond with step 6 for v3 and v5 which sets top bits | #*01010 for SHA1 or #*0011 for MD5 with `%uuid_time-high-and-version-request' | | 3) Set all the other bits to randomly (or pseudo-randomly) chosen | values. | `-> Slots `%uuid_time-low', `%uuid_time-mid', `%uuid-clock-seq-low', `%uuid_node' `---- :SEE-ALSO `make-v3-uuid', `make-v5-uuid', `make-v1-uuid', `make-null-uuid', `*random-state-uuid*', `cl:random'.

MAKE-V5-UUID (NAMESPACE NAME)

Generates an RFC4122 version 5 (nambe based SHA1) UUID with NAME in NAMESPACE. Return value is an instance of the class UNIQUE-UNIVERSAL-IDENTIFIER. NAMESPACE is a UUID namespace object. NAME is a string. :EXAMPLE (make-v5-uuid *uuid-namespace-dns* "bubba") :SEE-ALSO `<XREF>'.

SXHASH-UUID (UUID)

Return the `sxhash' of UUID's representation as an object of type `uuid-bit-vector-128'. UUID is an instance of the class `unique-universal-identifier'. :EXAMPLE (sxhash-uuid (make-v4-uuid)) (sxhash-uuid (make-v3 uuid *uuid-namespace-dns* "bubba")) (sxhash-uuid (make-v5-uuid *uuid-namespace-dns* "bubba")) (let ((v4-instance (make-v4-uuid)) (v5-instance (make-v5-uuid *uuid-namespace-dns* "bubba")) (v3-instance (make-v3-uuid *uuid-namespace-dns* "bubba"))) (and (eq (sxhash-uuid v5-instance) (sxhash-uuid (uuid-copy-uuid v5-instance))) (eq (sxhash-uuid v3-instance) (sxhash-uuid (uuid-copy-uuid v3-instance))) (eq (sxhash-uuid v4-instance) (sxhash-uuid (uuid-copy-uuid v4-instance))))) :SEE-ALSO `uuid-eql', `uuid-copy-uuid', `uuid-to-bit-vector', `sb-int:bit-vector-='.

UNIQUE-UNIVERSAL-IDENTIFIER-NULL-P (OBJECT)

Whether object is an instance of the class `unicly::unique-universal-identifier-null' and its value is `cl:eq' that of special variable `unicly::*uuid-null-uuid*'. :EXAMPLE (unique-universal-identifier-null-p *uuid-null-uuid*) (unique-universal-identifier-null-p (make-null-uuid)) (type-of (make-instance 'unique-universal-identifier-null)) ;; Following both fail successfully: (unique-universal-identifier-null-p (make-instance 'unicly::unique-universal-identifier-null)) (unique-universal-identifier-null-p (make-instance 'unicly::unique-universal-identifier)) :SEE-ALSO `unicly:unique-universal-identifier-p'.

UUID-AS-URN-STRING (STREAM UUID)

Print UUID as a URN (Universal Resource Name) to STREAM. Return value has the format: urn:uuid:<UUID> UUID is an instance of `unique-universal-identifier' class. STREAM is an output-stream of type `stream-or-boolean-or-string-with-fill-pointer'. :EXAMPLE (string= (uuid-as-urn-string nil (make-null-uuid)) "urn:uuid:00000000-0000-0000-0000-000000000000") :NOTE Per RFC4122 Section 3. "Namespace Registration Template" ,---- | The hexadecimal values "a" through "f" are output as | lower case characters and are case insensitive on input. `---- :SEE-ALSO `make-uuid-from-string', `uuid-print-bytes', `uuid-print-bytes-to-string', `uuid-princ-to-string', `uuid-string-parse-integer'.

UUID-BIT-VECTOR-NULL-P (BIT-VECTOR-MAYBE-NULL)

Whether BIT-VECTOR-MAYBE-NULL is of type `unicly:uuid-bit-vector-null'. :EXAMPLE (uuid-bit-vector-null-p (uuid-bit-vector-128-zeroed)) (uuid-bit-vector-null-p (make-array 128 :element-type 'bit :initial-element 1)) (null (uuid-bit-vector-null-p (uuid-byte-array-16-zeroed))) :SEE-ALSO `unicly:uuid-bit-vector-eql', `unicly:uuid-bit-vector-128-zeroed', `unicly:uuid-bit-vector-128', `unicly:uuid-bit-vector-128-p'.

UUID-BIT-VECTOR-TO-BYTE-ARRAY (UUID-BV-128)

Convert UUID-BV-128 to a UUID-BYTE-ARRAY-16. Arg UUID-BV-128 should satisfy `uuid-bit-vector-128-check-type'. :EXAMPLE (equalp (uuid-bit-vector-to-byte-array (uuid-to-bit-vector (make-v5-uuid *uuid-namespace-dns* "bubba"))) (uuid-to-byte-array (make-v5-uuid *uuid-namespace-dns* "bubba"))) :SEE-ALSO `<XREF>'.

UUID-BIT-VECTOR-V3-P (UUID-BIT-VECTOR)

<DOCSTR> :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `uuid-version-bit-vector', `uuid-bit-vector-v3-p', `uuid-bit-vector-v4-p' `uuid-bit-vector-v5-p', `uuid-bit-vector-128', `uuid-eql'.

UUID-BIT-VECTOR-V4-P (UUID-BIT-VECTOR)

<DOCSTR> :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `uuid-version-bit-vector', `uuid-bit-vector-v3-p', `uuid-bit-vector-v4-p' `uuid-bit-vector-v5-p', `uuid-bit-vector-128', `uuid-eql'.

UUID-BIT-VECTOR-V5-P (UUID-BIT-VECTOR)

<DOCSTR> :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `uuid-version-bit-vector', `uuid-bit-vector-v3-p', `uuid-bit-vector-v4-p' `uuid-bit-vector-v5-p', `uuid-bit-vector-128', `uuid-eql'.

UUID-BYTE-ARRAY-16-P (MAYBE-OBJECT-OF-TYPE)

Whether MAYBE-UUID-BYTE-ARRAY-16 is of type `uuid-byte-array-16'. Return T when MAYBE-UUID-BYTE-ARRAY-16 has the type signature: (simple-array (unsigned-byte 8) (16)) :EXAMPLE (uuid-byte-array-16-p (uuid-to-byte-array *uuid-namespace-dns*)) :SEE-ALSO `uuid-hex-string-36', `uuid-hex-string-36-p'.

UUID-BYTE-ARRAY-16-TO-INTEGER (UUID-BA-16)

Convert a UUID byte-array representaton to its decimal integer representaton. UUID-BA-16 is an object of type `uuid-byte-array-16'. Return value is an integer with an upper-bounds of a `uuid-ub128'. :EXAMPLE (uuid-bit-vector-to-integer (uuid-to-bit-vector (make-v5-uuid *uuid-namespace-dns* "bubba"))) ;=> 317192554773903544674993329975922389959 (uuid-integer-128-to-byte-array 317192554773903544674993329975922389959) ;=> #(238 161 16 94 54 129 81 23 153 182 123 43 95 225 243 199) (uuid-byte-array-16-to-integer (uuid-integer-128-to-byte-array 317192554773903544674993329975922389959)) ;=> 317192554773903544674993329975922389959 :SEE-ALSO `<XREF>'.

UUID-BYTE-ARRAY-16-ZEROED

Return an array of type `uuid-byte-array-16' with all elements zeroed. :EXAMPLE (uuid-byte-array-16-zeroed) (typep (uuid-byte-array-16-zeroed) 'uuid-byte-array-16) (uuid-byte-array-16-p (uuid-byte-array-16-zeroed)) :SEE-ALSO `uuid-bit-vector-128-zeroed', `uuid-byte-array-16-p', `uuid-byte-array-null-p', `uuid-byte-array-null'.

UUID-BYTE-ARRAY-NULL-P (BYTE-ARRAY-MAYBE-NULL)

Whether object is of type `unicly:uuid-byte-array-null'. :EXAMPLE (uuid-byte-array-null-p (uuid-byte-array-16-zeroed)) (uuid-byte-array-null-p (make-array 16 :element-type 'uuid-ub8 :initial-element 0)) (not (uuid-byte-array-null-p (make-array 16 :element-type 'uuid-ub8 :initial-element 1))) (not (uuid-byte-array-null-p (uuid-bit-vector-128-zeroed))) :SEE-ALSO `uuid-byte-array-16-zeroed', `uuid-byte-array-16-p'.

UUID-BYTE-STRING-P (MAYBE-OBJECT-OF-TYPE)

Whether object is of type `uuid-byte-string'. Return T when object has the type signature: (simple-array character (16)) :EXAMPLE (uuid-byte-string-p (uuid-get-bytes (uuid-print-bytes nil *uuid-namespace-dns*))) :SEE-ALSO `uuid-hex-string-36-p', `uuid-byte-array-16-p'.

UUID-COPY-UUID (UUID-INSTANCE)

Copy slot-value's of UUID-INSTANCE to new instance and return new instance. UUID-INSTANCE should satisfy `unique-universal-identifier-p', an error is signaled if not. :EXAMPLE (let* ((source *uuid-namespace-dns*) (clone (uuid-copy-uuid source))) (not (or (eq clone source) (eql clone source) (equal clone source) (equalp clone source)))) :NOTE The base slot-values of an instance of `unique-universal-identifier' class are constants and satisfy `cl:constantp': (constantp (slot-value *uuid-namespace-dns* '%uuid_time-low)) Therefor, the newly returned copy will not share mutable structure with its source UUID-INSTANCE. :NOTE Because there should only ever be one true instance of the null-uuid when UUID-INSTANCE satisfies `unique-universal-identifier-null-p' the returned copy of UUID-INSTANCE is an instance of class `unique-universal-identifier' not an instance of class `unique-universal-identifier-null' and the returned copy does not satisfy `unique-universal-identifier-null-p'. For example: (unique-universal-identifier-null-p (make-null-uuid)) (unique-universal-identifier-null-p (uuid-copy-uuid (make-null-uuid))) (type-of (uuid-copy-uuid (make-null-uuid))) :SEE-ALSO `<XREF>'.

UUID-FROM-BYTE-ARRAY (BYTE-ARRAY)

Convert BYTE-ARRAY to a UUID. Return value is an instance of the UNIQUE-UNIVERSAL-IDENTIFIER class. BYTE-ARRAY is a byte-array as returned by `uuid-to-byte-array' it should be of type `uuid-to-byte-array' and satisfy the predicate `uuid-to-byte-array-p': :EXAMPLE (uuid-from-byte-array (uuid-to-byte-array (make-uuid-from-string "6ba7b814-9dad-11d1-80b4-00c04fd430c8"))) :SEE-ALSO `<XREF>'.

UUID-GET-NAMESPACE-BYTES (UUID)

Convert UUID to a byte-array. Arg UUID should be an instance of the UNIQUE-UNIVERSAL-IDENTIFIER class. Return value is an array of type `uuid-byte-array-16' with the type signature: (simple-array (unsigned-byte 8) (16)) It will satisfy the predicate `uuid-byte-array-16-p'. :EXAMPLE (uuid-get-namespace-bytes *uuid-namespace-dns*) :SEE-ALSO `uuid-from-byte-array'.

UUID-HEX-STRING-32-P (MAYBE-UUID-HEX-STRING-32)

Whether object is of type `uuid-hex-string-32'. Return T when object has the type signature: (array character (32)) and satisfies `mon:string-all-hex-char-p'. :EXAMPLE (uuid-hex-string-32-p (uuid-print-bytes nil *uuid-namespace-dns*)) ;; Following fails successfully: (uuid-hex-string-32-p (print-object *uuid-namespace-dns* nil)) :SEE-ALSO `uuid-hex-string-36', `uuid-hex-string-36-p'.

UUID-HEX-STRING-36-P (MAYBE-UUID-HEX-STRING-36)

Whether MAYBE-UUID-HEX-STRING-36 is a valid string representation of a UUID. Return T when MAYBE-UUID-HEX-STRING-36 satisfies the following constraints: - Its type is '(array character 36) - When split to list of strings on #\- delimter the list is of length is 5 - The length of each string in the list matches the pattern 8-4-4-4-12 - each string in the list satisfies `mon:string-all-hex-char-p' :EXAMPLE (uuid-hex-string-36-p "6ba7b810-9dad-11d1-80b4-00c04fd430c8") (uuid-hex-string-36-p "6BA7B810-9DAD-11D1-80B4-00C04FD430C8") ;; Following fails successfully: (uuid-hex-string-36-p "6BA7B810--9DAD-11D1-80B4-00C04FD430C8") :SEE-ALSO `uuid-hex-string-32-p', `uuid-hex-string-32', `%uuid-hex-string-36-null-string-p' `mon:split-string-on-chars'.

UUID-STRING-32-P (MAYBE-OBJECT-OF-TYPE)

Whether object is of type `uuid-string-32'. :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `<XREF>'.

UUID-STRING-36-P (MAYBE-OBJECT-OF-TYPE)

Whether object is of type `uuid-string-36'. :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `<XREF>'.

Undocumented

UUID-BIT-VECTOR-128-P (MAYBE-OBJECT-OF-TYPE)

UUID-BIT-VECTOR-EQL (UUID-BV-A UUID-BV-B)

UUID-BYTE-ARRAY-TO-BIT-VECTOR (UUID-BYTE-ARRAY)

UUID-FROM-BIT-VECTOR (BIT-VECTOR-128)

UUID-TO-BIT-VECTOR (UUID)

UUID-VERSION-UUID (UUID)

Private

%MAKE-UUID-FROM-BIT-VECTOR-EXTENDABLE-BV-ZEROED-ERROR (MAYBE-VALID-UUID-BIT-VECTOR)

Return MAYBE-VALID-UUID-BIT-VECTOR or error if it is `unicly::uuid-bit-vector-null-p'. :EXAMPLE (let ((zero-bits (uuid-bit-vector-128-zeroed))) (setf (sbit zero-bits 0) 1) (%make-uuid-from-bit-vector-extendable-bv-zeroed-error zero-bits)) Following each fail succesfully: (%make-uuid-from-bit-vector-extendable-bv-zeroed-error (make-array 129 :element-type 'bit :initial-element 1)) (%make-uuid-from-bit-vector-extendable-bv-zeroed-error (make-array 129 :element-type 'bit :initial-element 1)) (%make-uuid-from-bit-vector-extendable-bv-zeroed-error (make-array 16 :element-type 'bit)) :SEE-ALSO `<XREF>'.

%MAKE-UUID-FROM-BYTE-ARRAY-EXTENDED-NULL-ARRAY-ERROR (MAYBE-VALID-UUID-BYTE-ARRAY)

Return MAYBE-VALID-UUID-BYTE-ARRAY if it is of type of type `unicly:uuid-byte-array-16' without without all octets `cl:zerop', if not an error is signaled. :EXAMPLE (%make-uuid-from-byte-array-extended-null-array-error (uuid-to-byte-array (make-v4-uuid))) (%make-uuid-from-byte-array-extended-null-array-error (uuid-byte-array-16-zeroed)) (null (ignore-errors (%make-uuid-from-byte-array-extended-null-array-error (make-array 3 :element-type 'uuid-ub8 :initial-contents #(255 255 255))))) (null (ignore-errors (%make-uuid-from-byte-array-extended-null-array-error (uuid-byte-array-16-zeroed)))) :SEE-ALSO `<XREF>'.

%MAKE-UUID-FROM-STRING-EXTENDED-NULL-STRING-ERROR (MAYBE-VALID-UUID-HEX-STRING-36)

Return MAYBE-VALID-UUID-HEX-STRING-36 if it is not `cl:string=' the constant `unicly::+uuid-null-string+'. MAYBE-VALID-UUID-HEX-STRING-36 is a string of type `unicly::uuid-string-36'. :EXAMPLE (%make-uuid-from-string-extended-null-string-error "eea1105e-3681-5117-99b6-7b2b5fe1f3c7") (%make-uuid-from-string-extended-null-string-error "not-a-valid-uuid-string-36") (null (ignore-errors (%make-uuid-from-string-extended-null-string-error "00000000-0000-0000-0000-000000000000"))) :SEE-ALSO `<XREF>'.

%UUID-HEX-STRING-36-NULL-STRING-P (SPLIT-VEC)

Whether MAYBE-ALL-ZERO-OR-DASH-STRING-36 is of type `uuid-hex-string-36' every character is `cl:char=' either #\0 or #\-. :EXAMPLE (%uuid-hex-string-36-null-string-p "00000000-0000-0000-0000-000000000000") (%uuid-hex-string-36-null-string-p "00000000-0000-0000-0000-000000000001") :SEE-ALSO `uuid-hex-string-36-p'.

%UUID_CLOCK-SEQ-AND-RESERVED-REQUEST (BYTE-ARRAY)

Steps seven and eight of RFC4122 Section 4.3: Step seven: - Set the clock_seq_hi_and_reserved field to octet 8 of the digest hash. Step eight: - Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively. IOW, set bit 6 to 0 - Set bit 7 to 1 :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `<XREF>'.

%UUID_CLOCK-SEQ-LOW-REQUEST (BYTE-ARRAY)

Step nine of RFC4122 Section 4.3: - Set the clock_seq_low field to octet 9 of the hash. :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `<XREF>'.

%UUID_NODE-REQUEST (BYTE-ARRAY)

Step ten or RFC4122 Section 4.3: - Set octets zero through five of the node field to octets 10 through 15 of the digest hash. :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `<XREF>'.

%UUID_TIME-HIGH-AND-VERSION-REQUEST (BYTE-ARRAY VERSION)

Steps five and six of RFC4122 Section 4.3: Step five: - Set octets zero and one of the time_hi_and_version field to octets 6 and 7 of the digest hash. Step six: - Set the four most significant bits (bits 12 through 15) of the time_hi_and_version field to the appropriate 4-bit version number per the table below. Msb0 Msb1 Msb2 Msb3 Version 0 1 0 1 5 0 0 1 1 3 0 1 0 0 4 ; :NOTE Not relevant to this operation. MSB LSB 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 1 ; v3 0 1 0 1 0 0 0 0 0 0 1 1 1 0 0 1 ; v5 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 1 ; v4 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 !---------! UUID v3 bit-field 12345 => #b0011000000111001 (length "0011000000111001") => 16 #b0011000000111001 !--! UUID v5 bit-field 20759 => #b0101000100010111 (length "0101000100010111") => 16 #b0101000100010111 !--! UUID v4 bit-field :NOTE Per RFC 4.1.3 bit 48 in a uuid-bit-vector-128 should always be 0. :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `<XREF>'.

%UUID_TIME-LOW-REQUEST (BYTE-ARRAY)

Step three of RFC4122 Section 4.3: - Set octets zero through 3 of the time_low field to octets zero through 3 of the digest hash. :EXAMPLE (%uuid_time-low-request (uuid-get-namespace-bytes (make-v5-uuid *uuid-namespace-dns* "bubba"))) (%uuid_time-low-request (uuid-get-namespace-bytes (make-v3-uuid *uuid-namespace-dns* "bubba"))) (%uuid_time-low-request (uuid-get-namespace-bytes (make-v4-uuid *uuid-namespace-dns* "bubba"))) :SEE-ALSO `<XREF>'.

%UUID_TIME-MID-REQUEST (BYTE-ARRAY)

Step four of RFC4122 Section 4.3: - Set octets zero and one of the time_mid field to octets 4 and 5 of the digest hash. :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `<XREF>'.

%VERIFY-DIGEST-VERSION (CHK-VERSION)

Return one of the symbols :MD5 or :SHA1 depending on value of CHK-VERSION. When CHK-VERSION is 3 return :MD5 When CHK-VERSION is 5 return :SHA1 CHK-VERSION should satisfy `%verify-version-3-or-5', an error is signaled if not. Helper function for `uuid-digest-uuid-string' :EXAMPLE (%verify-digest-version 3) (%verify-digest-version 5) ;; Following fails successfully: (%verify-digest-version 6) :SEE-ALSO `<XREF>'.

%VERIFY-NON-EMPTY-NAME-ARG (NAME-ARG)

If value of `unicly::*uuid-allow-empty-string-name-args*' is T retrun NAME-ARG. If value of NAME-ARG is of type `unicly::string-not-empty' retrun NAME-ARG, if not and error is signaled. :EXAMPLE (%verify-non-empty-name-arg "bubba") (let ((*uuid-allow-empty-string-name-args* t)) (%verify-non-empty-name-arg "")) (null (ignore-errors (%verify-non-empty-name-arg ""))) :SEE-ALSO `unicly::verify-sane-namespace-and-name', `unicly::%verify-non-null-namespace-arg'.

%VERIFY-SLOT-BOUNDP-AND-TYPE (VERIFY-UUID)

Check that VERIFY-UUID has all slots `cl:slot-boundp' and of the correct type. Signal either a `cl:simple-condition' or `cl:type-error' error if not. Helper function for `uuid-copy-uuid'. :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `<XREF>'.

%VERIFY-VALID-SUBCLASS-AND-SLOTS (SUBCLASS-TO-VERIFY)

Return SUBCLASS-TO-VERIFY when SUBCLASS-TO-VERIFY satisfies both: `unicly::%verify-valid-uuid-subclass-type' `unicly::%verify-valid-uuid-subclass-slots' If not, an error is signaled. SUBCLASS-TO-VERIFY is a symbol designating a class which subclasses the class `unicly:unique-universal-identifier'. :EXAMPLE (%verify-valid-subclass-and-slots 'indexable-uuid) ; assuming it exists (null (ignore-errors (%verify-valid-subclass-and-slots 'unique-universal-identifier))) :SEE-ALSO `<XREF>'.

%VERIFY-VALID-UUID-SUBCLASS-SLOTS (CLASS-TO-VERIFY)

Instantiate an instance of CLASS-TO-VERIFY as if by `cl:make-instance' and ensure that each slot of the class 'unicly:unique-universal-identifier is `cl:slot-exists-p' for the instantiated instance and that their default `cl:slot-value' is `cl:zerop', if so return CLASS-TO-VERIFY, if not, an error is signaled. :EXAMPLE (%verify-valid-uuid-subclass-slots 'unique-universal-identifier) :NOTE The evaluation of `cl:make-instance' should finalize CLASS-TO-VERIFY if it is not already. :NOTE This function is evaluated _after_ `unicly::%verify-valid-uuid-subclass' by `unicly::%verify-valid-subclass-and-slots' and is not evaluated when class CLASS-TO-VERIFY is not a valid subclass of the class `unicly::unique-universal-identifier' :SEE-ALSO `<XREF>'.

%VERIFY-VALID-UUID-SUBCLASS-TYPE (MAYBE-VALID-UUID-SUBCLASS)

Return MAYBE-VALID-UUID-SUBCLASS if it is verifiably `cl:subtypep' the class `unicly:unique-universal-identifier' and not `cl:eq' the symbol UNIQUE-UNIVERSAL-IDENTIFIER, an error is signaled if not. MAYBE-VALID-UUID-SUBCLASS is a symbol designating a subclass. :EXAMPLE (null (ignore-errors (%verify-valid-uuid-subclass-type 'unique-universal-identifier))) (null (ignore-errors (%verify-valid-uuid-subclass-type 42))) (null (ignore-errors (%verify-valid-uuid-subclass-type 'cl:structure-class))) :SEE-ALSO `<XREF>'.

%VERIFY-VERSION-3-OR-5

Verify that arg VERSION is either the integer 3 or 5. Signal an error if not. Helper function for `digested-v3or5-uuid'. :EXAMPLE (%verify-version-3-or-5 3) (%verify-version-3-or-5 5) ;; Following fails successfully: (%verify-version-3-or-5 6) :SEE-ALSO `%verify-digest-version'.

DIGESTED-V3OR5-UUID (DIGEST-BYTE-ARRAY DIGEST-3-OR-5)

Helper function to format UUIDv3 and UUIDv5 hashes according to UUID-VERSION. DIGEST-BYTE-ARRAY is an argument suitable as the BYTE-ARRAY arg to `uuid-request-integer'. DIGEST-BYTE-ARRAY is as per the the return value of `digested-v3or5-uuid' UUID-VERSION should satisfy `%verify-version-3-or-5', an error is signaled if not. :EXAMPLE { ... <EXAMPLE> ... } :SEE-ALSO `<XREF>'.

MAKE-UUID-FROM-STRING-IF (UUID-HEX-STRING-36-IF)

Helper function for `make-uuid-from-string'. If UUID-HEX-STRING-36-IF satisfies `uuid-hex-string-36-p' return it. If the constraint fails signal a `mon:simple-error-mon' condition. :EXAMPLE (make-uuid-from-string-if "6ba7b810-9dad-11d1-80b4-00c04fd430c8") (make-uuid-from-string-if "6ba7b810-9dad--11d1-80b4-00c04fd430c8") :SEE-ALSO `<XREF>'.

UUID-ASSEMBLE-UB16 (B1 B2)

Return an integer of type `uuid-ub48' constructed of the uuid-ub8 octets B1 and B2. HIGH ---> LOW B1 ... B6 :EXAMPLE (let ((ub16 #xFFFF)) (multiple-value-bind (b1 b2) (uuid-disassemble-ub16 ub16) (eql (uuid-assemble-ub16 b1 b2) ub16))) :SEE-ALSO `uuid-assemble-ub48', `uuid-assemble-ub32', `uuid-disassemble-ub48', `uuid-disassemble-ub32', `uuid-disassemble-ub16', `uuid-request-integer', `uuid-byte-array-16-to-integer'.

UUID-ASSEMBLE-UB32 (B1 B2 B3 B4)

Return an integer of type `uuid-ub32' constructed of the uuid-ub8 octets B1, B2, B3, and B4. HIGH ---> LOW B1 ... B4 :EXAMPLE (let ((ub32 #xFFFFFFFF)) (multiple-value-bind (b1 b2 b3 b4) (uuid-disassemble-ub32 ub32) (eql (uuid-assemble-ub32 b1 b2 b3 b4) ub32))) :SEE-ALSO `uuid-assemble-ub48', `uuid-assemble-ub16', `uuid-disassemble-ub48', `uuid-disassemble-ub32', `uuid-disassemble-ub16', `uuid-request-integer', `uuid-byte-array-16-to-integer'.

UUID-ASSEMBLE-UB48 (B1 B2 B3 B4 B5 B6)

Return an integer of type `uuid-ub48' constructed of the uuid-ub8 octets B1, B2, B3, B4, B5, and B6. HIGH ---> LOW B1 ... B6 :EXAMPLE (let ((ub48 #xFFFFFFFFFFFF)) (multiple-value-bind (b1 b2 b3 b4 b5 b6) (uuid-disassemble-ub48 ub48) (eql (uuid-assemble-ub48 b1 b2 b3 b4 b5 b6) ub48))) :SEE-ALSO `uuid-assemble-ub32', `uuid-assemble-ub16', `uuid-disassemble-ub48', `uuid-disassemble-ub32', `uuid-disassemble-ub16', `uuid-request-integer', `uuid-byte-array-16-to-integer'.

UUID-BIT-VECTOR-128-ZEROED

Return a bit vector of 128 elements with all elements zeroed. :EXAMPLE (uuid-bit-vector-128-zeroed) (typep (uuid-bit-vector-128-zeroed) 'uuid-bit-vector-128) :SEE-ALSO `uuid-bit-vector-128', `uuid-deposit-octet-to-bit-vector', `uuid-byte-array-to-bit-vector', `make-null-uuid'.

UUID-BIT-VECTOR-TO-INTEGER (BIT-VECTOR)

Return BIT-VECTOR's representation as a positive integer. BIT-VECTOR is an object of type `cl:simple-bit-vector'. :EXAMPLE (uuid-bit-vector-to-integer (uuid-to-bit-vector (make-v4-uuid))) :NOTE This is a modified version of a a "BIT-VECTOR-TO-INTEGER" function written by Stas Boukarev using `cl:flet' and `cl:loop'. :SEE :FILE unicly/unicly.lisp for additional details. :SEE-ALSO `<XREF>'.

UUID-BYTE-ARRAY-20-P (MAYBE-OBJECT-OF-TYPE)

Whether MAYBE-UUID-BYTE-ARRAY-16 is of type `uuid-byte-array-20'. Return T when MAYBE-UUID-BYTE-ARRAY-16 has the type signature: (simple-array (unsigned-byte 8) (20)) :EXAMPLE (uuid-byte-array-20-p (uuid-string-to-sha1-byte-array "bubba")) :SEE-ALSO `uuid-hex-string-36', `uuid-hex-string-36-p'.

UUID-DELIMITED-STRING-36-P (MAYBE-DELIM-STRING-36)

Whether MAYBE-DELIM-STRING-36 is potentially of type `uuid-hex-string-36' or `uuid-hex-string-36-zeroed' Return nil when MAYBE-DELIM-STRING-36 is not `uuid-string-36-p'. Else, return as if by `cl:values': cl:nth-value-0 is T cl:nth-value-1 is an object of type (simple-vector 5) each elt of vector is a simple-string generated by splitting MAYBE-DELIM-STRING-36 at occurences of #\-. An object will satisfy `uuid-string-36-p' when following constraints are met: - Its type is '(array character 36) - When split to list of strings on the character delimter #\- the list is of length is 5 - The length of each string in the list matches the pattern 8-4-4-4-12 - each string in the list satisfies is a hexadecimal character or #\- :EXAMPLE (uuid-delimited-string-36-p (uuid-princ-to-string (make-v4-uuid))) (uuid-delimited-string-36-p (uuid-princ-to-string (make-null-uuid))) (uuid-delimited-string-36-p (make-string 36 :initial-element #\-)) :SEE-ALSO `<XREF>'.

UUID-DIGEST-UUID-INSTANCE (DIGEST-VERSION UUID-NAMESPACE-INSTANCE NAME)

This is step two of RFC4122 Section 4.3: - Compute the digest hash of the name space ID concatenated with the name. DIGEST-VERSION is an interger value either (3 or 5) indicateing the type of hash to digest where 3 indicates :MD5 for a v3 UUID and 5 indicates :SHA1 for a v5 UUID. It should satisfy `%verify-digest-version', and error is signaled if not. Arg UUID-NAMESPACE-INSTANCE is an instance of class `unique-universal-identifier' indicating the namespace of NAME. NAME is a string of arbitrary length and should be encoded as UTF-8 (or subset of). When DIGEST-VERSION is 3 return value is an object of type `uuid-byte-array-16' suitable for use as the V3-DIGEST-BYTE-ARRAY argument to `digested-v3-uuid'. When DIGEST-VERSION is 5 return value is an object of type `uuid-byte-array-20' suitable for use as the V5-DIGEST-BYTE-ARRAY argument to `digested-v5-uuid'. :EXAMPLE (uuid-digest-uuid-instance 3 *uuid-namespace-dns* "bubba") (uuid-digest-uuid-instance 5 *uuid-namespace-dns* "bubba") (uuid-byte-array-16-p (uuid-digest-uuid-instance 3 *uuid-namespace-dns* "bubba")) (uuid-byte-array-20-p (uuid-digest-uuid-instance 5 *uuid-namespace-dns* "bubba")) :SEE-ALSO `%uuid-digest-uuid-instance-md5', `%uuid-digest-uuid-instance-sha1'.

UUID-DISASSEMBLE-UB16 (U16)

Return two uuid-ub8 octets of U16 as if by `cl:values'. U16 is an integer of type `uuid-ub16' corresponding to either the `%uuid_time-high-and-version' or `%uuid_time-mid' slots of an instance of class `unique-universal-identifier'. :EXAMPLE (uuid-disassemble-ub16 (slot-value (make-v5-uuid *uuid-namespace-dns* "buuba") '%uuid_time-mid)) (multiple-value-list (uuid-disassemble-ub16 13953)) (eq (nth-value 0 (uuid-disassemble-ub16 13953)) 54) (eq (nth-value 0 (uuid-disassemble-ub16 13953)) 129) :SEE-ALSO `uuid-disassemble-ub48', `uuid-disassemble-ub32', `uuid-disassemble-ub16'.

UUID-DISASSEMBLE-UB32 (U32)

Return U32 as four integer values of type `uuid-ub8' as if by `cl:values'. U32 is an integer of type `uuid-ub32' corresponding to the `%uuid_time-low' slot of an instance of class `unique-universal-identifier'. :EXAMPLE (slot-value (make-v4-uuid) '%UUID_TIME-LOW) (uuid-disassemble-ub32 (slot-value (make-v5-uuid *uuid-namespace-dns* "bubba"))) (equal (multiple-value-list (uuid-disassemble-ub16 13953)) '(54 129)) :SEE-ALSO `uuid-disassemble-ub48', `uuid-disassemble-ub32', `uuid-disassemble-ub16'.

UUID-DISASSEMBLE-UB48 (U48)

Return U48 as six integer values of type uuid-ub8 as if by `cl:values'. U48 is an integer of type `uuid-ub48'. corresponding to the `%uuid_node' slot of an instance of class `unique-universal-identifier'. :EXAMPLE (multiple-value-list (uuid-disassemble-ub48 (slot-value (make-v5-uuid *uuid-namespace-dns* "buuba") '%uuid_node))) :SEE-ALSO `uuid-disassemble-ub48', `uuid-disassemble-ub32', `uuid-disassemble-ub16'.

UUID-INTEGER-128-TO-BIT-VECTOR (UUID-INTEGER-128)

Convert the decimal integer representation of a UUID to a `uuid-bit-vector-128'. :EXAMPLE (uuid-bit-vector-eql (uuid-integer-128-to-bit-vector 317192554773903544674993329975922389959) (uuid-to-bit-vector (make-v5-uuid *uuid-namespace-dns* "bubba"))) (uuid-bit-vector-eql (uuid-integer-128-to-bit-vector 317192554773903544674993329975922389959) (uuid-byte-array-to-bit-vector (uuid-integer-128-to-byte-array 317192554773903544674993329975922389959))) :SEE-ALSO `<XREF>'.

UUID-REQUEST-INTEGER (ARRAY OFFSET LENGTH &KEY LITTLE-ENDIAN SIGN-EXTEND)

Decode an integer of LENGTH octets from ARRAY starting at OFFSET. The number represented by BYTE-ARRAY may be any positive integer representable in 48 bits. The OFFSET is effectively :start and LENGTH is :end where :end => (+ offset length) x86-32 OSs are LITTLE-ENDIAN but network-byte-order is big-endian... :EXAMPLE (uuid-request-integer (uuid-number-to-byte-array 281474976710654) 0 6) :SEE-ALSO `<XREF>'.

UUID-SERIALIZE-BYTE-ARRAY-BYTES (UUID-OR-BYTE-ARRAY-16 STREAM-OUT)

Serialize UUID to STREAM. Bytes of UUID are written to STREAM. Stream should have an :element-type '(unsigned-byte 8). :EXAMPLE (let ((file (make-pathname :directory '(:absolute "tmp") :name "temp-bytes")) (w-uuid (make-v5-uuid *uuid-namespace-dns* "bubba")) (gthr '())) (with-open-file (s file :if-exists :supersede :if-does-not-exist :create :direction :output :element-type 'uuid-ub8) (uuid-serialize-byte-array-bytes w-uuid s)) (with-open-file (stream file :element-type 'uuid-ub8) (do ((code (read-byte stream nil :eof) (read-byte stream nil :eof))) ((eql code :eof)) (push code gthr))) (and gthr (setf gthr (uuid-from-byte-array (make-array 16 :element-type 'uuid-ub8 :initial-contents (nreverse gthr))))) (unwind-protect (list (uuid-eql w-uuid gthr) gthr w-uuid) (delete-file file))) :SEE-ALSO `<XREF>'.

UUID-SIMPLE-TYPE-ERROR (&KEY DATUM EXPECTED-TYPE)

Convenience function for signaling conditions of type `unicly::uuid-simple-type-error'. Keywords DATUM and EXPECTED-TYPE are as per condition class CL:TYPE-ERROR. :EXAMPLE (uuid-simple-type-error :datum "bubba" :expected-type 'simple-bit-vector) :SEE-ALSO `<XREF>'.

UUID-TO-BYTE-ARRAY (UUID)

Convert UUID to a byte-array. Arg UUID should be an instance of the UNIQUE-UNIVERSAL-IDENTIFIER class. Return value is an array of type `uuid-byte-array-16' with the type signature: (simple-array (unsigned-byte 8) (16)) It will satisfy the predicate `uuid-byte-array-16-p'. :EXAMPLE (uuid-get-namespace-bytes *uuid-namespace-dns*) :SEE-ALSO `uuid-from-byte-array'.

UUID-VALID-STREAM-P (MAYBE-STREAM)

Whether STREAM is `cl:streamp' and `cl:open-stream-p'. Return as if by `cl:values': cl:nth-value 0 is a boolean cl:nth-value 1 is value of STREAM arg :EXAMPLE (let ((os (make-string-output-stream))) (unwind-protect (uuid-valid-stream-p os) (close os))) (uuid-valid-stream-p "bubba") :SEE-ALSO `uuid-valid-stream-verify-io-type', `uuid-valid-stream-verify-for-input', `uuid-valid-stream-verify-for-output'.

UUID-VALID-STREAM-VERIFY-FOR-INPUT (IN-STREAM)

Return STREAM if it is valid for use as when reading a UUID representation. Signal an error if STREAM is not true for either `uuid-valid-stream-p' or `cl:input-stream-p'. :EXAMPLE (let ((stream-in (make-string-input-stream "bubba is ok")) (stream-read (make-array 11 :element-type 'character))) (values (uuid-valid-stream-verify-for-input stream-in) (progn (read-sequence stream-read stream-in ) stream-read))) ;; Following fails succesfully: (uuid-valid-stream-verify-for-input "bubba") :SEE-ALSO `uuid-valid-stream-verify-io-type', `uuid-valid-stream-verify-for-output'.

UUID-VALID-STREAM-VERIFY-FOR-OUTPUT (OUT-STREAM)

Return STREAM if it is valid for use as when writing a UUID representation. Signal an error if STREAM is not true for either `uuid-valid-stream-p' or `cl:outpu-stream-p'. :EXAMPLE (with-output-to-string (bubba) (and (uuid-valid-stream-verify-for-output bubba) (princ "bubba is ok" bubba))) ;; Following fails succesfully: (uuid-valid-stream-verify-for-output "bubba") :SEE-ALSO `uuid-valid-stream-verify-io-type', `uuid-valid-stream-verify-for-input'.

UUID-VALID-STREAM-VERIFY-IO-TYPE (MAYBE-VALID-IO-STREAM &KEY DIRECTION)

Return STREAM if it is valid for use as when writing a UUID representation. Keyword DIRECTION is as per `cl:open'. Valid values are either: :INPUT :OUTPUT An error is signaled if STREAM is not `uuid-valid-stream-p'. When DIRECTION is :OUTPUT and stream is not `cl:output-stream-p' an error is signaled. When DIRECTION is :INPUT and stream is not `cl:input-stream-p' an error is signaled. :SEE-ALSO `uuid-valid-stream-verify-io-type', `uuid-valid-stream-verify-for-input', `uuid-valid-stream-verify-for-output'.

UUID-VERSION-BIT-VECTOR (UUID-BIT-VECTOR)

Return the version of uuid version of UUID-BIT-VECTOR. UUID-BIT-VECTOR is on object of type `uuid-bit-vector-128'. When object is the null uuid return as if by `cl:values': 0,null-uuid If for some reason bit 48 of object is not `cl:zerop' an error is signaled. :EXAMPLE (uuid-version-bit-vector (uuid-to-bit-vector (make-v4-uuid))) (uuid-version-bit-vector (uuid-to-bit-vector (make-v5-uuid *uuid-namespace-dns* "bubba"))) (uuid-version-bit-vector (uuid-to-bit-vector (make-v3-uuid *uuid-namespace-dns* "bubba"))) (uuid-version-bit-vector (uuid-to-bit-vector (make-null-uuid))) ;; Following successfully signals an error: (let ((bv-z (uuid-bit-vector-128-zeroed))) (setf (sbit bv-z 48) 1) (uuid-version-bit-vector bv-z)) :SEE-ALSO `uuid-version-bit-vector', `uuid-bit-vector-v3-p', `uuid-bit-vector-v4-p' `uuid-bit-vector-v5-p', `uuid-bit-vector-128', `uuid-eql'.

VERIFY-SANE-NAMESPACE-AND-NAME (NAMESPACE NAME)

Return as if by cl:values the uuid-byte-array representations of NAMESPACE and NAME. NAMESPACE is an object of type `unicly:unique-universal-identifier'. NAME is a string. Depending on value of special variables: `*uuid-allow-null-like-namespace-args*' `*uuid-allow-empty-string-name-args*' Signal an error if NAMESPACE is a null-uuid not satisfying `unique-universal-identifier-null-p'. Siganl an error if NAME fails to satisfy `unicly::%string-not-empty-p'. :EXAMPLE (verify-sane-namespace-and-name (make-v4-uuid) "bubba") (let ((*uuid-allow-empty-string-name-args* t)) (verify-sane-namespace-and-name (make-v4-uuid) "")) (null (ignore-errors (verify-sane-namespace-and-name (make-v4-uuid) ""))) (let ((*uuid-allow-null-like-namespace-args* t)) (verify-sane-namespace-and-name (make-instance 'unique-universal-identifier) "bubba")) (let ((*uuid-allow-null-like-namespace-args* t) (*uuid-allow-empty-string-name-args* t)) (verify-sane-namespace-and-name (make-instance 'unique-universal-identifier) "")) :SEE-ALSO `unicly::%verify-non-empty-name-arg', `unicly::%verify-non-null-namespace-arg'.

Undocumented

%DEF-UUID-FORMAT-AND-INTERN-SYMBOL (FORMAT-STRING FORMAT-ARG)

%DEF-UUID-FORMAT-AND-INTERN-SYMBOL-TYPE-CHECKER (TYPE-SYMBOL-OR-STRING)

%DEF-UUID-FORMAT-AND-INTERN-SYMBOL-TYPE-PREDICATE (TYPE-SYMBOL-OR-STRING)

%LW-STRING-ZEROP (STRING)

%MAKE-NULL-UUID-LOADTIME

%STRING-NOT-EMPTY-P (MAYBE-NOT-NULL-OR-EMPTY-STRING)

%UNIQUE-UNIVERSAL-IDENTIFIER-NULL-P (OBJECT)

%UUID-BIT-VECTOR-NULL-P (BIT-VECTOR-MAYBE-NULL)

%UUID-BYTE-ARRAY-NULL-P (BYTE-ARRAY-MAYBE-NULL)

%UUID-DIGEST-UUID-INSTANCE-MD5 (NAMESPACE NAME)

%UUID-DIGEST-UUID-INSTANCE-SHA1 (NAMESPACE NAME)

%UUID-OCTETS-TO-STRING (CONVERT-BYTE-ARRAY)

%UUID-STRING-TO-OCTETS (NAME-ARG)

%UUID-UUID-VERSION-IF (UUID-TIME-HIGH-AND-VERSION UUID)

%UUID-VERSION-BIT-VECTOR-IF (UUID-BIT-VECTOR)

%UUID_BYTE-ARRAY-16-UB8-REQEUST (BYTE-ARRAY OFFSET)

%UUID_CLOCK-SEQ-AND-RESERVED-REQUEST-BIT-VECTOR (BIT-VECTOR-128)

%UUID_CLOCK-SEQ-LOW-REQUEST-BIT-VECTOR (BIT-VECTOR-128)

%UUID_NODE-REQUEST-BIT-VECTOR (BIT-VECTOR-128)

%UUID_TIME-HIGH-AND-VERSION-REQUEST-BIT-VECTOR (BIT-VECTOR-128)

%UUID_TIME-LOW-REQUEST-BIT-VECTOR (BIT-VECTOR-128)

%UUID_TIME-MID-REQUEST-BIT-VECTOR (BIT-VECTOR-128)

%VERIFY-NON-NULL-NAMESPACE-ARG (NAMESPACE-ARG)

DIGESTED-V3-UUID (V3-DIGEST-BYTE-ARRAY)

DIGESTED-V5-UUID (V5-DIGEST-BYTE-ARRAY)

DOC-SET (NAME OBJECT-TYPE STRING ARGS)

FUNDOC (NAME &OPTIONAL STRING &REST ARGS)

GENERIC-DOC (FUNCTION-DESIGNATOR &OPTIONAL DOC-STRING &REST ARGS)

HEXADECIMAL-CHAR-P (MAYBE-HEX-CHAR)

METHOD-DOC (GENERIC-FUNCTION-DESIGNATOR QUALIFIERS SPECIALIZERS &OPTIONAL DOC-STRING &REST ARGS)

SIMPLE-STRING-COMPAT-P (MAYBE-SIMPLE-STRING-COMPAT)

STRING-ALL-HEX-CHAR-P (MAYBE-HEX-STRING)

STRING-NOT-NULL-OR-EMPTY-P (STR)

STRING-WITH-FILL-POINTER-CHECK-TYPE (CHECKED-VAL)

STRING-WITH-FILL-POINTER-P (MAYBE-OBJECT-OF-TYPE)

TYPE-SPECIFIER-P (OBJECT)

TYPEDOC (NAME &OPTIONAL STRING &REST ARGS)

UUID-BIT-VECTOR-128-CHECK-TYPE (CHECKED-VAL)

UUID-BIT-VECTOR-16-CHECK-TYPE (CHECKED-VAL)

UUID-BIT-VECTOR-16-P (MAYBE-OBJECT-OF-TYPE)

UUID-BIT-VECTOR-16-ZEROED

UUID-BIT-VECTOR-32-CHECK-TYPE (CHECKED-VAL)

UUID-BIT-VECTOR-32-P (MAYBE-OBJECT-OF-TYPE)

UUID-BIT-VECTOR-32-ZEROED

UUID-BIT-VECTOR-48-CHECK-TYPE (CHECKED-VAL)

UUID-BIT-VECTOR-48-P (MAYBE-OBJECT-OF-TYPE)

UUID-BIT-VECTOR-48-ZEROED

UUID-BIT-VECTOR-8-ZEROED

UUID-BIT-VECTOR-BUILD-OFFSETS (BIT-OFFSET BIT-WIDTH)

UUID-BYTE-ARRAY-16-CHECK-TYPE (CHECKED-VAL)

UUID-BYTE-ARRAY-20-CHECK-TYPE (CHECKED-VAL)

UUID-BYTE-ARRAY-CHECK-TYPE (CHECKED-VAL)

UUID-BYTE-ARRAY-P (MAYBE-OBJECT-OF-TYPE)

UUID-BYTE-STRING-CHECK-TYPE (CHECKED-VAL)

UUID-DEPOSIT-OCTET-TO-BIT-VECTOR (OCTET OFFSET UUID-BV)

UUID-DESERIALIZE-BIT-VECTOR-BITS (STREAM-IN)

UUID-DESERIALIZE-BYTE-ARRAY-BYTES (STREAM-IN)

UUID-HEX-VECTOR-PARSE-CLOCK-SEQ-AND-RESERVED (HEX-VECTOR-5)

UUID-HEX-VECTOR-PARSE-CLOCK-SEQ-LOW (HEX-VECTOR-5)

UUID-HEX-VECTOR-PARSE-NODE (HEX-VECTOR-5)

UUID-HEX-VECTOR-PARSE-TIME-HIGH-AND-VERSION (HEX-VECTOR-5)

UUID-HEX-VECTOR-PARSE-TIME-LOW (HEX-VECTOR-5)

UUID-HEX-VECTOR-PARSE-TIME-MID (HEX-VECTOR-5)

UUID-INTEGER-128-TO-BYTE-ARRAY (UUID-INTEGER)

UUID-OCTET-TO-BIT-VECTOR-8 (OCTET)

UUID-READ-BIT-VECTOR-BITS (INPUT-PATHNAME &KEY (IF-DOES-NOT-EXIST ERROR))

UUID-SERIALIZE-BIT-VECTOR-BITS (BV-OR-UUID STREAM-OUT)

UUID-SIMPLE-VECTOR-5-CHECK-TYPE (CHECKED-VAL)

UUID-SIMPLE-VECTOR-5-P (MAYBE-OBJECT-OF-TYPE)

UUID-STRING-32-CHECK-TYPE (CHECKED-VAL)

UUID-STRING-36-CHECK-TYPE (CHECKED-VAL)

UUID-VALID-STREAM-VERIFY-IO-OCTET-TYPE (MAYBE-OCTET-STREAM &KEY DIRECTION)

UUID-VALID-STREAM-VERIFY-OCTET-STREAM-FOR-INPUT (MAYBE-INPUT-OCTET-STREAM)

UUID-VALID-STREAM-VERIFY-OCTET-STREAM-FOR-OUTPUT (MAYBE-OUTPUT-OCTET-STREAM)

UUID-VERIFY-BIT-VECTOR-SIMPLICITY (PUTATIVE-SIMPLE-BIT-VECTOR)

VARDOC (NAME &OPTIONAL STRING &REST ARGS)

VECTOR-WITH-FILL-POINTER-P (OBJECT)

MACRO

Private

DEF-INDEXED-HEXSTRING-INTEGER-PARSER (FUN-NAME VEC-INDEX STRING-TYPE-AT-INDEX STRING-START STRING-END STRING-INTEGER-TYPE)

Convenience macro for defining functions which `cl:parse-integer' of the simple-array character elements returnd as nth-value 1 as an object of type `uuid-simple-vector-5' by `uuid-hex-string-36-p' FUN-NAME is a string used when generating a function-name to intern in the UNICLY package. String should not be preceded/trailed by #\- or whitespace. Arg VEC-INDEX is an integer value of type (mod 5) indicating an index into the return value of `uuid-hex-string-36-p'. Arg STRING-TYPE-AT-INDEX is an unqouted symol naming a subtype of `uuid-hex-string-length'. Valid types are: `uuid-hex-string-8' `uuid-hex-string-4' `uuid-hex-string-12' Arg STRING-START is a postivie integer indicating the lower bounds of the hex-string located at VEC-INDEX. Arg STRING-END is a postivie integer value indicating an upper bounds of the hex-string located at VEC-INDEX. STRING-INTEGER-TYPE Is an unquoted symbol naming an uuid unsigned-byte type to declare for the value returned by `cl:parse-integer' of the string at VEC-INDEX. Valid types are: `uuid-ub32' `uuid-ub16' `uuid-ub8' `uuid-ub48' Expands to a function defining form with the following format: (defun <FUN-NAME> (hex-vector-5) (declare (uuid-simple-vector-5 hex-vector-5) (optimize (speed 3))) (uuid-string-parse-integer (uuid-svref-for-parse-integer HEX-VECTOR-5 <VEC-INDEX> <STRING-TYPE-AT-INDEX>) <STRING-START> <STRING-END> <STRING-INTEGER-TYPE> )) :EXAMPLE (macroexpand-1 '(def-indexed-hexstring-integer-parser "time-low" 0 uuid-hex-string-8 0 8 uuid-ub32)) :SEE-ALSO `uuid-hex-vector-parse-time-low', `uuid-hex-vector-parse-time-mid', `uuid-hex-vector-parse-time-high-and-version', `uuid-hex-vector-parse-clock-seq-and-reserved', `uuid-hex-vector-parse-clock-seq-low', `uuid-hex-vector-parse-node'.

DEF-MAKE-UUID-EXTEND-CLASS-FUN (MAKE-EXTENDED-SUFFIX EXTENDED-CLASS)

Define functions which provide a the equivalent of the Unicly uuid API for subclasses of the class `unicly:unique-universal-identifier'. MAKE-EXTENDED-SUFFIX is a non-quoted symbol which is appended to the symbol-name of each defined function. EXTENDED-CLASS is a non-quoted which designates a valid subclass of the class `unicly:unique-universal-identifier'. Following table outlines the correspondence of extended functions defined with their standard Unicly counterparts: Extended Unicly API function Standard Unicly API function make-v3-uuid-<FOO> `make-v3-uuid' make-v4-uuid-<FOO> `make-v4-uuid' make-v5-uuid-<FOO> `make-v5-uuid' make-uuid-from-string-<FOO> `make-uuid-from-string' make-uuid-from-byte-array-<FOO> `uuid-from-byte-array' make-uuid-from-bit-vector-<FOO> `uuid-from-bit-vector' :SEE-ALSO `<XREF>'.

DEF-UUID-BIT-VECTOR-LENGTH-TYPE (BV-LENGTH)

Convenience macro for defining subtypes of type `uuid-bit-vector-length'. Arg BV-LENGTH is an positive integer value indicating the length of a uuid-bit-vector. :EXAMPLE (macroexpand-1 '(def-uuid-bit-vector-length-type 16)) :SEE-ALSO `def-uuid-type-definer', `def-uuid-unsigned-byte-size', `def-uuid-bit-vector-N-type', `def-uuid-bit-vector-length-type', `def-uuid-unsigned-byte-integer-length', `def-uuid-uuid-hex-string-length', `def-uuid-byte-array-length'.

DEF-UUID-BIT-VECTOR-N-TYPE (BV-LENGTH-TYPE)

Convenience macro for defining subtypes of type `uuid-bit-vector'. Arg BV-LENGTH-TYPE is an positive integer value indicating the number of bits in a uuid-bit-vector. :EXAMPLE (macroexpand-1 '(def-uuid-bit-vector-N-type 16)) :SEE-ALSO `def-uuid-type-definer', `def-uuid-unsigned-byte-size', `def-uuid-bit-vector-N-type', `def-uuid-bit-vector-length-type', `def-uuid-unsigned-byte-integer-length', `def-uuid-uuid-hex-string-length', `def-uuid-byte-array-length'.

DEF-UUID-BYTE-ARRAY-LENGTH (BYTE-ARRAY-LENGTH)

Convenience macro for defining subtypes of type `uuid-byte-array'. BYTE-ARRAY-LENGTH is a positive integer indication the length of a simple-array with elements of type `uuid-ub8'. :EXAMPLE (macroexpand-1 '(def-uuid-byte-array-length 16)) :SEE-ALSO `def-uuid-type-definer', `def-uuid-unsigned-byte-size', `def-uuid-bit-vector-N-type', `def-uuid-bit-vector-length-type', `def-uuid-unsigned-byte-integer-length', `def-uuid-uuid-hex-string-length', `def-uuid-byte-array-length'.

DEF-UUID-PREDICATE-AND-TYPE-CHECK-DEFINER (TYPE-FOR-PRED-AND-CHECK)

Convenience macro for defining predicate and check-type functions for Unicly types. TYPE-FOR-PRED-AND-CHECK is a token designating an existing type-specifier. Its symbol-name is used to generate two symbol-names to use as function names when defining a the predicate and check-type functions. Generated predicate name has the form: <TYPE-FOR-PRED-AND-CHECK>-P Generated check-type name has the form: <TYPE-FOR-PRED-AND-CHECK>-CHECK-TYPE So given the type specifier UUID-BIT-VECTOR-8 the following two functions would be definened: uuid-bit-vector-8-p uuid-bit-vector-8-check-type In the case, uuid-bit-vector-8-check-type is defined with a body which checks if some value satisfies uuid-bit-vector-8-p and if not signals a condition of type `uuid-simple-type-error' its body having the format: (unless (uuid-bit-vector-8-p <SOME-VALUE>) (uuid-simple-type-error :datum <SOME-VALUE> :expected-type uuid-bit-vector-8)) :EXAMPLE (macroexpand-1 '(def-uuid-predicate-and-type-check-definer uuid-bit-vector-32)) (macroexpand-all '(def-uuid-predicate-and-type-check-definer uuid-bit-vector-32)) :NOTE The body of this macro expands into two addtional macros: `unicly::def-uuid-type-predicate-definer' `unicly::def-uuid-type-check-definer' :SEE-ALSO `<XREF>'.

DEF-UUID-REQUEST-INTEGER-BIT-VECTOR (DEF-NAME BIT-OFFSET BIT-WIDTH)

Convenience macro for functions which extract slot values of class `unique-universal-identifier'. :EXAMPLE (macroexpand-1 '(def-uuid-request-integer-bit-vector "time-low" 0 32)) (macroexpand-1 '(def-uuid-request-integer-bit-vector "time-mid" 32 16)) (macroexpand-1 '(def-uuid-request-integer-bit-vector "time-high-and-version" 48 16)) (macroexpand-1 '(def-uuid-request-integer-bit-vector "clock-seq-and-reserved" 64 8)) (macroexpand-1 '(def-uuid-request-integer-bit-vector "clock-seq-low" 72 8)) (macroexpand-1 '(def-uuid-request-integer-bit-vector "node" 80 48)) :SEE-ALSO `%uuid_time-low-request-bit-vector', `%uuid_time-mid-request-bit-vector', `%uuid_time-high-and-version-request-bit-vector', `%uuid_clock-seq-and-reserved-request-bit-vector', `%uuid_clock-seq-low-request-bit-vector', `%uuid_node-request-bit-vector'.

DEF-UUID-TYPE-DEFINER (PARENT-TYPE FORMAT-STRING LENGTH-ARG)

Convenience macro for use by macros which define uuid sub-type specifiers. Arg PARENT-TYPE is an unquoted symbol naming a uuid-type specifer which accepts a positive integer value as an argument. FORMAT-STRING is a format-string used to generate the symbol-name of the type to be defined. The types defined with by expanders of this macro have an integer value as part of theier symbol name, as such format-string should contain the format-control flag "~D" in an appropriate position. LENGTH-ARG an positive integer value. It is used as the format-argument to FORMAT-STRING and as the argument to its PARENT-TYPE. :EXAMPLE (macroexpand-1 '(def-uuid-type-definer uuid-bit-vector "UUID-BIT-VECTOR-~D" 128)) :SEE-ALSO `def-uuid-type-definer', `def-uuid-unsigned-byte-size', `def-uuid-bit-vector-N-type', `def-uuid-bit-vector-length-type', `def-uuid-unsigned-byte-integer-length', `def-uuid-uuid-hex-string-length', `def-uuid-byte-array-length'.

DEF-UUID-UNSIGNED-BYTE-INTEGER-LENGTH (UNSIGNED-LENGTH)

Convenience macro for defining subtypes of type `uuid-unsigned-byte-integer-length'. Arg UNSIGNED-LENGTH is an positive integer value indicating the integer-length of the integer represetned at the upper-bounds of an unsigned-byte. :EXAMPLE (macroexpand-1 '(def-uuid-unsigned-byte-integer-length 16)) :SEE-ALSO `def-uuid-type-definer', `def-uuid-unsigned-byte-size', `def-uuid-bit-vector-N-type', `def-uuid-bit-vector-length-type', `def-uuid-unsigned-byte-integer-length', `def-uuid-uuid-hex-string-length'.

DEF-UUID-UNSIGNED-BYTE-SIZE (SIZE-BYTES)

Convenience macro for defining subtypes of type `uuid-unsigned-byte-size'. Arg SIZE-BYTES is an positive integer value indicating the size of an unsigned-byte. :EXAMPLE (macroexpand-1 '(def-uuid-unsigned-byte-size 128)) :SEE-ALSO `def-uuid-type-definer', `def-uuid-unsigned-byte-size', `def-uuid-bit-vector-N-type', `def-uuid-bit-vector-length-type', `def-uuid-unsigned-byte-integer-length', `def-uuid-uuid-hex-string-length', `def-uuid-byte-array-length'.

DEF-UUID-UUID-HEX-STRING-LENGTH (HEX-STRING-LENGTH)

Convenience macro for defining subtypes of type `uuid-hex-string-length'. Arg HEX-STRING-LENGTH is an positive integer value indicating the length of a simple-array of characters. :EXAMPLE (macroexpand-1 '(def-uuid-uuid-hex-string-length 12)) :SEE-ALSO `def-uuid-type-definer', `def-uuid-unsigned-byte-size', `def-uuid-bit-vector-N-type', `def-uuid-bit-vector-length-type', `def-uuid-unsigned-byte-integer-length', `def-uuid-uuid-hex-string-length'.

UUID-STRING-PARSE-INTEGER (UUID-HEX-STRING START END INTEGER-TYPE)

Helper macro for `make-uuid-from-string' to `cl:parse-integer' a hex-string. Wraps macro `uuid-svref-for-parse-integer'. Wrapped by macro `def-indexed-hexstring-integer-parser'. Arg UUID-HEX-STRING is a `uuid-hex-string-36' or a subtype. Arg START is a lower bounds indexing into UUID-HEX-STRING. Arg END is an upper bounds indexing into UUID-HEX-STRING. INTEGER-TYPE is an unquoted symbol naming the type of uuid-unsigned-byte-size to declare for the value returned by `cl:parse-integer' of the hex-string at at index bounded by START and END Valid types are: `uuid-ub32' `uuid-ub16' `uuid-ub8' `uuid-ub48' :EXAMPLE (macroexpand-1 '(uuid-string-parse-integer "6ba7b810-9dad-11d1-80b4-00c04fd430c8" 0 8 uuid-ub32)) (let ((uuid-str "6ba7b810-9dad-11d1-80b4-00c04fd430c8") (parse-specs '((0 8 uuid-ub32) (9 13 uuid-ub16) (14 18 uuid-ub16) (19 21 uuid-ub8) (21 23 uuid-ub8) (24 36 uuid-ub48))) (gthr '())) (dolist (m parse-specs (setf gthr (nreverse gthr))) (push (apply #'uuid-string-parse-integer m) gthr))) :SEE-ALSO `make-uuid-from-string-if'.

UUID-SVREF-FOR-PARSE-INTEGER (SIMPLE-VECTOR-5 INDEX STRING-TYPE)

Convenience macro for declared references to STRING-TYPEs at INDEX of SIMPLE-VECTOR-5. Wrapped by macros `def-indexed-hexstring-integer-parser' and `uuid-string-parse-integer'. SIMPLE-VECTOR-5 is an object of type `uuid-simple-vector-5' as returned as the `cl:nth-value' 1 of `uuid-hex-string-36-p'. STRING-TYPE is a subtype of `uuid-hex-string-length' Arg STRING-TYPE is an unqouted symol naming the type of string at INDEX. It should be a subtype of `uuid-hex-string-length'. Valid types are: `uuid-hex-string-8' `uuid-hex-string-4' `uuid-hex-string-12' :EXAMPLE (macroexpand-1 '(uuid-svref-for-parse-integer (nth-value 1 (uuid-hex-string-36-p (uuid-princ-to-string (make-v4-uuid)))) 4 uuid-hex-string-12)) :SEE-ALSO `<XREF>'.

Undocumented

DEF-MAKE-UUID-BYTE-ARRAY-EXTENDED (MAKE-EXTENDED-SUFFIX EXTENDED-CLASS &OPTIONAL (NO-VERIFY NIL))

DEF-MAKE-UUID-FROM-STRING-EXTENDED (MAKE-EXTENDED-SUFFIX EXTENDED-CLASS &OPTIONAL (NO-VERIFY NIL))

DEF-MAKE-V3-UUID-EXTENDED (MAKE-V3-UUID-SUFFIX V3-UUID-CLASS &OPTIONAL (NO-VERIFY NIL))

DEF-MAKE-V4-UUID-EXTENDED (MAKE-V4-UUID-SUFFIX V4-UUID-CLASS &OPTIONAL (NO-VERIFY NIL))

DEF-MAKE-V5-UUID-EXTENDED (MAKE-V5-UUID-SUFFIX V5-UUID-CLASS &OPTIONAL (NO-VERIFY NIL))

DEF-UUID-BIT-VECTOR-ZEROED (ZEROED-SIZE)

DEF-UUID-FROM-BIT-VECTOR-EXTENDABLE (MAKE-UUID-FROM-BV-SUFFIX UUID-BV-CLASS &OPTIONAL (NO-VERIFY NIL))

DEF-UUID-TYPE-CHECK-DEFINER (TYPE-CHECK-NAME NAME-PREDICATE CHECKED-TYPE)

DEF-UUID-TYPE-PREDICATE-DEFINER (PREDICATE-NAME TYPE-TO-CHECK)

DEFCONST (NAME VALUE &OPTIONAL DOC)

GENERIC-FUNCTION

Public

UNIQUE-UNIVERSAL-IDENTIFIER-P (OBJECT)

Whether MAYBE-UUID-INSTANCE is a unique-universal-identifier. Return T if argument is a class instance of `unique-universal-identifier' or one of its subclasses. :EXAMPLE (unique-universal-identifier-p *uuid-namespace-dns*) (unique-universal-identifier-p (uuid-to-bit-vector *uuid-namespace-dns*)) (unique-universal-identifier-p t) :SEE-ALSO `uuid-eql', `unicly::unique-universal-identifier-null-p'.

UUID-EQL (UUID-A UUID-B)

Whether object UUID-A is eql UUID-B. :EXAMPLE (uuid-eql (make-v5-uuid *uuid-namespace-dns* "bubba") (make-v5-uuid *uuid-namespace-dns* "bubba")) (uuid-eql (make-v5-uuid *uuid-namespace-dns* "bubba") (make-v5-uuid *uuid-namespace-dns* "bubbA")) (uuid-eql "bubb" "bobby") (uuid-eql *uuid-null-uuid* *uuid-null-uuid*) (uuid-eql *uuid-null-uuid* (make-null-uuid)) (uuid-eql (make-null-uuid) *uuid-null-uuid*) (uuid-eql (make-null-uuid) (%make-null-uuid-loadtime)) (uuid-eql (make-null-uuid) (%make-null-uuid-loadtime)) (uuid-eql (make-null-uuid) (make-instance 'unique-universal-identifier-null)) (uuid-eql (make-instance 'unique-universal-identifier-null) (make-instance 'unique-universal-identifier-null)) (uuid-eql (make-instance 'unique-universal-identifier-null) (make-null-uuid)) (uuid-eql (make-instance 'unique-universal-identifier) (make-null-uuid)) :NOTE When either UUID-A or UUID-B is an instance of the class `unicly::unique-universal-identifier-null' they are only considered to be `unicly:uuid-eql' if both objects are `cl:eql' the value of special variable `unicly::*uuid-null-uuid*'. :SEE-ALSO `unique-universal-identifier-p'.

UUID-PRINC-TO-STRING (UUID)

Return string representation of UUID-INSTANCE as if by `cl:princ-to-string'. :SEE-ALSO `uuid-print-bytes-to-string', `uuid-print-bytes'.

UUID-PRINT-BIT-VECTOR (UUID &KEY STREAM)

Print the bit-vector representation of UUID in a format suitable to its class to STREAM. UUID an object representing an instance of `unique-universal-identifier' class or subclass. STREAM is an output-stream. :SEE-ALSO `uuid-print-bytes-to-string'.

UUID-PRINT-BYTES-TO-STRING (UUID &KEY STRING-OR-CHAR-TYPE (UPCASE NIL) (STRING-OR-CHAR-TYPE 'BASE-CHAR))

Print the bytes of UUID in a format suitable to its class to a string. When keyword STRING-OR-CHAR-TYPE is non-nil specializing methods may provide opmitimizations around this arg. :SEE-ALSO `uuid-print-bytes'.

Private

UUID-PRINT-BYTES (STREAM UUID)

Print the bytes of UUID in a format suitable to its class to STREAM. UUID an object representing an instance of `unique-universal-identifier' class or subclass. STREAM is an output-stream. :SEE-ALSO `uuid-print-bytes-to-string'.

Undocumented

UUID-BIT-48-ERROR-DATUM (CONDITION)

UUID-BIT-48-ERROR-EXPECTED-TYPE (CONDITION)

UUID-SLOT-UNBOUND-NAME (CONDITION)

UUID-SLOT-UNBOUND-OBJECT (CONDITION)

VARIABLE

Public

*UUID-NAMESPACE-DNS*

A DNS namespace as provided with RFC4122 Appendix C. "Some Name Space IDs". It is suggested that this may be used as the NAMESPACE arg when generating v3 and v5 UUIDs where NAME is a string designating a FQDN (Fully-Qualified Domain Name). :EXAMPLE (unique-universal-identifier-p *uuid-namespace-dns*) The default value of this namespace is generated from the hexadecimal integers provided for `NameSpace_DNS` page 29 of the appendix. These are: #x6ba7b810 ;; uuid-ub32 #x9dad ;; uuid-ub16 #x11d1 ;; uuid-ub16 #x80 ;; uuid-ub8 #xb4 ;; uuid-ub8 #x00 #xc0 #x4f #xd4 #x30 #xc8 ;; uuid-ub48 With the string representation: "6ba7b810-9dad-11d1-80b4-00c04fd430c8" :SEE-ALSO `make-v3-uuid', `make-v5-uuid', `make-v4-uuid'.

*UUID-NAMESPACE-OID*

An OID namespace as provided with RFC4122 Appendix C. "Some Name Space IDs". It is suggested that this may be used as the NAMESPACE arg when generating v3 and v5 UUIDs where NAME is a string designating an ISO OID . :EXAMPLE (unique-universal-identifier-p *uuid-namespace-oid*) The default value for this namespace is generated from the hexadecimal integers provided with RFC4122 Appendix C. - "Some- Name Space IDs" page 29. #x6ba7b812 ;; uuid-ub32 #x9dad ;; uuid-ub16 #x11d1 ;; uuid-ub16 #x80 ;; uuid-ub8 #xb4 ;; uuid-ub8 #x00 #xc0, #x4f, #xd4, #x30, #xc8 ;; uuid-ub48 With the string representaton: "6ba7b812-9dad-11d1-80b4-00c04fd430c8" :SEE (URL `http://www.techabulary.com/o/oid/') :SEE-ALSO `make-v3-uuid', `make-v5-uuid', `make-v4-uuid'.

*UUID-NAMESPACE-URL*

An URL namespace as provided with RFC4122 Appendix C. "Some Name Space IDs". It is suggested that this may be used as the NAMESPACE arg when generating v3 and v5 UUIDs where NAME is a string designating an URL (Universal Resource Locator). :EXAMPLE (unique-universal-identifier-p *uuid-namespace-url*) The default value for this namespace is generated from the hexadecimal integers provided with RFC4122 Appendix C. - "Some- Name Space IDs" page 29. These are: #x6ba7b811 ;; uuid-ub32 #x9dad ;; uuid-ub16 #x11d1 ;; uuid-ub16 #x80 ;; uuid-ub8 #xb4 ;; uuid-ub8 #x00 #xc0, #x4f, #xd4, #x30, #xc8 ;; uuid-ub48 With the string representation: "6ba7b811-9dad-11d1-80b4-00c04fd430c8" :SEE-ALSO `make-v3-uuid', `make-v5-uuid', `make-v4-uuid'.

*UUID-NAMESPACE-X500*

An x500 namespace as provided with RFC4122 Appendix C. "Some Name Space IDs". It is suggested that this may be used as the NAMESPACE arg when generating v3 and v5 UUIDs where NAME is a string designating an an X.500 Distinguished Name in DER (Distinguished Encoding Rules) or a text output format. :EXAMPLE (unique-universal-identifier-p *uuid-namespace-x500*) The default value for this namespace is generated from the hexadecimal integers provided with RFC4122 Appendix C. - "Some- Name Space IDs" page 29. #x6ba7b812 ;; uuid-ub32 #x9dad ;; uuid-ub16 #x11d1 ;; uuid-ub16 #x80 ;; uuid-ub8 #xb4 ;; uuid-ub8 #x00 #xc0, #x4f, #xd4, #x30, #xc8 ;; uuid-ub48 With the string representaton: "6ba7b812-9dad-11d1-80b4-00c04fd430c8" :SEE (URL `http://en.wikipedia.org/wiki/X.500') :SEE (URL `http://luca.ntop.org/Teaching/Appunti/asn1.html') esp. Section 6. :SEE-ALSO `make-v3-uuid', `make-v5-uuid', `make-v4-uuid'.

Private

*RANDOM-STATE-UUID*

A random-state objet for use when generating UUIDv4 UUIDs. :EXAMPLE *random-state-uuid* (random-state-p *random-state-uuid*) :SEE-ALSO `cl:random-state', `cl:random-state-p'.

*UUID-ALLOW-EMPTY-STRING-NAME-ARGS*

When value is null `make-v3-uuid' and `make-v5-uuid' will error when their NAME argumement is not of type `unicly::string-not-empty'. :SEE-ALSO `*uuid-allow-null-like-namespace-args*', `unicly::verify-sane-namespace-and-name', `unicly::%verify-non-empty-name-arg', `unicly::%verify-non-null-namespace-arg'.

*UUID-ALLOW-NULL-LIKE-NAMESPACE-ARGS*

When value is null, `make-v3-uuid' and `make-v5-uuid' will error when their NAMESPACE argumement is an instance of the class `unique-universal-identifier' with all of its slot-values satisfying `cl:zerop' but which doesn't satisfy `unique-universal-identifier-null-p'. :NOTE RFC 4122 probably didn't have CLOS in mind w/r/t the null-uuid and as such when either of the following type of object is allowed as a NAMESPACE argument it may produce unexpected results and with unexpected consequences which may not be easily detected after the fact: (unique-universal-identifier-null-p (make-instance 'unique-universal-identifier)) (unique-universal-identifier-null-p (make-instance 'unique-universal-identifier-null)) (unique-universal-identifier-null-p (make-instance 'mop-frobbed-subclass-of-unique-universal-identifier)) Their may be a performance impact when this argument is nil (the default) b/c we will have to check the slot-values of each namespace arg for each evaluation of `make-v5-uuid' / `make-v3-uuid'. A reasonable way to avoid this impact is to cache the NAMESPACEs common to a class you control and dynamically bind this variable inside a wrapper function: (make-v5-uuid-with-cached-namespace (name) (let ((*uuid-allow-null-like-namespace-args* t)) (make-v5-uuid <CACHED-NAMESPACE> name))) :SEE-ALSO `*uuid-allow-empty-string-name-args*', `unicly::verify-sane-namespace-and-name', `unicly::%verify-non-empty-name-arg', `unicly::%verify-non-null-namespace-arg'.

*UUID-NULL-UUID*

The default null-uuid per RFC4122 Section 4.1.7 "Nil UUID". The value of this variable is initialized at loadtime with `unicly::%make-null-uuid-loadtime'. User code should not neither direclty access nor set the value of this variable and should instead always use `unicly:make-null-uuid'! It is an an object of type `unicly::unique-universal-identifier-null'. The value of this variable should always evalute to the same object as there are methods specialized it, e.g.: (uuid-eql *uuid-null-uuid* *uuid-null-uuid*) (uuid-eql *uuid-null-uuid* (make-null-uuid)) (uuid-eql (make-null-uuid) *uuid-null-uuid*) (uuid-eql *uuid-null-uuid* (make-instance 'unicly::unique-universal-identifier-null)) (uuid-eql *uuid-null-uuid* (make-instance 'unicly::unique-universal-identifier)) :NOTE The value of this variable should always return t for the following: (and (slot-exists-p *uuid-null-uuid* '%uuid_null) (slot-value *uuid-null-uuid* '%uuid_null)) :SEE-ALSO `<XREF>'.

Undocumented

*HEXADECIMAL-CHARS*

CLASS

Public

UNIQUE-UNIVERSAL-IDENTIFIER

Representation of an UUID. The string representation of A UUID has the format: clock-seq-and-reserved time-mid | clock-seq-low | | | 6ba7b810-9dad-11d1-80b4-00c04fd430c8 | | | ` time-low | ` node ` time-high-and-version Each field is treated as an integer and has its value printed as a zero-filled hexadecimal digit string with the most significant digit first. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | %uuid_time-low | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | %uuid_time-mid | %uuid_time-high-and-version | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |clk-seq-hi-res | clock-seq-low | %uuid_node (0-1) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | %uuid_node (2-5) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Following table enumates the slot/type/value correspondence for instances of this class: SLOT TYPE BYTE-ARRAY SIZE `%uuid_time-low' `uuid-ub32' #(<BYTE> <BYTE> <BYTE> <BYTE>), 4 `%uuid_time-mid' `uuid-ub16' #(<BYTE> <BYTE>), 2 `%uuid_time-high-and-version' `uuid-ub16' #(<BYTE> <BYTE>), 2 `%uuid_clock-seq-and-reserved' `uuid-ub8' #(<BYTE>), 1 `%uuid_clock-seq-low' `uuid-ub8' #(<BYTE>), 1 `%uuid_node' `uuid-ub48' #(<BYTE> <BYTE> <BYTE> <BYTE> <BYTE> <BYTE>), 6 While RFC4122 specifically indicates that certain bits of a UUID shall not be set and/or are reserved for future use, were the full range of its 128 bit integer representation used it could have an upper bounds with the decimal representation: 340282366920938463463374607431768211455 e.g.: (integer-length 340282366920938463463374607431768211455) => 128 In long-form this number is: 340,282,366,920,938,463,463,374,607,431,768,211,455 340 undecillion, 282 decillion, 366 nonillion, 920 octillion, 938 septillion, 463 sextillion, 463 quintillion, 374 quadrillion, 607 trillion, 431 billion, 768 million, 211 thousand and 455 :SEE-ALSO `<XREF>'.

Private

UNIQUE-UNIVERSAL-IDENTIFIER-NULL

Like instances of `unicly:unique-universal-identifier' but with all slots zeroed. There should only ever be one instance of this class and it should be the value of the special variable `unicly::*uuid-null-uuid*'. User code should neither set nor access the slot-values of this class, instead user code may gain access to a valid null-uuid with `make-null-uuid'. Though the consequences are undefined, it is an error for any slot-value of an instance of this class to be non-zero. ,---- RFC4122 section 4.1.7. "Nil UUID" | The nil UUID is special form of UUID that is specified to have all | 128 bits set to zero. `---- Following returns true when object is of type `unicly:unique-universal-identifier-null'. (slot-exists-p *uuid-null-uuid* '%uuid_null) Instance of this class return T for both `unicly:uuid-eql' and `unicly:uuid-bit-vector-eql' however not two null-uuids share identity under `cl:eq', `cl:eql', `cl:equal', `cl:equalp': (eq (make-instance 'unique-universal-identifier-null) (make-instance 'unique-universal-identifier)) (eql (make-instance 'unique-universal-identifier) (make-instance 'unique-universal-identifier)) (equal (make-instance 'unique-universal-identifier) (make-instance 'unique-universal-identifier)) (equalp (make-instance 'unique-universal-identifier) (make-instance 'unique-universal-identifier)) :SEE-ALSO `make-null-uuid'.

CONDITION

Private

UUID-BIT-48-ERROR

Condition for uuid related objects whose bit 48 is not `cl:zerop'. UUID-BIT-48-ERROR-DATUM is the object of the offending error. - When it is of type `unicly:unique-universal-identifier' this indicates that Msb0 (byte 1 15) of the '%uuid_time-high-and-version slot-value is 1. - When it is of type `unicly:uuid-bit-vector-128' this indicates that (sbit UUID-BIT-48-ERROR-DATUM 48) is 1. UUID-BIT-48-ERROR-EXPECTED-TYPE is a type specifier, it is defaulted to (mod 1). :EXAMPLE (error (make-condition 'uuid-bit-48-error :uuid-bit-48-error-datum (make-v4-uuid))) (error (make-condition 'uuid-bit-48-error :uuid-bit-48-error-datum (uuid-bit-vector-128-zeroed))) (error (make-condition 'uuid-bit-48-error :uuid-bit-48-error-datum (make-null-uuid))) :NOTE Above examples are for illustrative purposes only, the reported objects are in fact valid. Following examples are for legitimately invalid objects. (let ((v4uuid (make-v4-uuid))) (setf (slot-value v4uuid '%uuid_time-high-and-version) #xFFFF) (%uuid-version-uuid-if (slot-value v4uuid '%uuid_time-high-and-version) v4uuid)) (let* ((v4uuid (make-v4-uuid)) (v4-bv (uuid-to-bit-vector v4uuid))) (setf (sbit v4-bv 48) 1) (%uuid-version-bit-vector-if v4-bv)) :NOTE Intended callers of this condition are internal unicly dispatching functions: - `unicly::%uuid-version-uuid-if' - `unicly::%uuid-version-bit-vector-if' Under normal circumstances, neither of these functions likely to ever siganl so long as their arguments are uuid objects properly instantiated via the exposed unicly API, e.g. with `unicly:make-v[345]-uuid'. However, it is possible for an abstract representation of a uuid to be corrupt such that uuid objects instantiated from them by way of: - `unicly:make-uuid-from-string' - `unicly:uuid-from-byte-array' - `unicly:uuid-from-bit-vector' Where the resultant uuid could be faulty w/r/t its uuid version we should identify it. Of more concern are attempts to migrate uuid objects with origins from the equivalent UUID API esp. where it may create spurious uuid objects by way of `uuid:make-v1-uuid' which sets the wrong bits of the class uuid's time-high-and-version slot-value. It is wrong to propogate the errors of that implementations API further and we make some attempt to identify them. :SEE-ALSO `uuid-version-uuid', `uuid-version-bit-vector'.

UUID-ERROR

Superclass for all errors related to unicly.

UUID-SIMPLE-ERROR

Conditions for simple unicly errors.

UUID-SIMPLE-TYPE-ERROR (&KEY DATUM EXPECTED-TYPE)

Conditions for failed Unicly type declarations. Keyword FORMAT-CONTROL has a default-initarg which displays as: UUID-SIMPLE-TYPE-ERROR got-val: <GOT> type-of: <DATUM-TYPE-OF> expected: <EXPECTED-TYPE> Do not override FORMAT-CONTROL by providing an alternative argument as keyword FORMAT-ARGUMENTS is ignored. Keywords DATUM and EXPECTED-TYPE are as per condition class CL:TYPE-ERROR. Convenience function `uuid-simple-type-error' is provided for signalling this condition. :EXAMPLE (error 'uuid-simple-type-error :datum "bubba" :expected-type 'simple-bit-vector) (uuid-simple-type-error :datum "bubba" :expected-type 'simple-bit-vector)

UUID-SLOT-TYPE-ERROR

Conditions for unicly slot-type errors.

UUID-SLOT-UNBOUND-ERROR

Condition for `unicly:unique-universal-identifier' objects with unbound slots. UUID-SLOT-UNBOUND-NAME is a symbol naming the unbound slot in object. UUID-SLOT-UNBOUND-OBJECT is the uuid instance of with the unbound slot. :EXAMPLE (let ((v4uuid (make-v4-uuid))) (slot-makunbound v4uuid '%uuid_time-high-and-version) (error 'uuid-slot-unbound-error :uuid-slot-unbound-name '%uuid_time-high-and-version :uuid-slot-unbound-object v4uuid)) :SEE-ALSO `<XREF>'.

CONSTANT

Private

Undocumented

+%%UUID-SXHASH-TRUNCATING-NODE%%+

+UUID-NULL-STRING+