Liking cljdoc? Tell your friends :D

com.vadelabs.uid.uuid.interface

UUID generation and manipulation utilities following RFC9562.

Supports generation of:

  • v0: Null UUID
  • v1: Time-based UUID
  • v3: Name-based UUID (MD5)
  • v4: Random UUID
  • v5: Name-based UUID (SHA1)
  • v6: Time-based, lexically sortable UUID
  • v7: Unix time-based, lexically sortable UUID
  • v8: Custom UUID
  • squuid: Sequential UUID (non-standard)
UUID generation and manipulation utilities following RFC9562.

Supports generation of:
- v0: Null UUID
- v1: Time-based UUID
- v3: Name-based UUID (MD5)
- v4: Random UUID
- v5: Name-based UUID (SHA1)
- v6: Time-based, lexically sortable UUID
- v7: Unix time-based, lexically sortable UUID
- v8: Custom UUID
- squuid: Sequential UUID (non-standard)
raw docstring

+max+clj

source

+namespace-dns+clj

source

+namespace-oid+clj

source

+namespace-url+clj

source

+namespace-x500+clj

source

+null+clj

source

<clj

(< _)
(< x y)
(< x y & more)

Compare two or more UUIDs for < relation.

Compare two or more UUIDs for < relation.
sourceraw docstring

=clj

(= _)
(= x y)
(= x y & more)

Compare two or more UUIDs for equality.

Compare two or more UUIDs for equality.
sourceraw docstring

>clj

(> _)
(> x y)
(> x y & more)

Compare two or more UUIDs for > relation.

Compare two or more UUIDs for > relation.
sourceraw docstring

as-byte-arrayclj

(as-byte-array x)

Extract a byte serialization that represents the 'name' of x.

Extract a byte serialization that represents the 'name' of x.
sourceraw docstring

as-uuidclj

(as-uuid x)

Coerce the value 'x' to a UUID.

Coerce the value 'x' to a UUID.
sourceraw docstring

get-clk-highclj

(get-clk-high uuid)

Return the high 6 bits of the clock sequence.

Return the high 6 bits of the clock sequence.
sourceraw docstring

get-clk-lowclj

(get-clk-low uuid)

Return the low 8 bits of the clock sequence.

Return the low 8 bits of the clock sequence.
sourceraw docstring

get-clk-seqclj

(get-clk-seq uuid)

Return the clock-sequence number for v1/v6 UUIDs. Returns nil for other versions.

Return the clock-sequence number for v1/v6 UUIDs.
Returns nil for other versions.
sourceraw docstring

get-instantclj

(get-instant uuid)

Return a java.util.Date object for time-based UUIDs (v1, v6, v7). Returns nil for non-time-based UUIDs.

Return a java.util.Date object for time-based UUIDs (v1, v6, v7).
Returns nil for non-time-based UUIDs.
sourceraw docstring

get-node-idclj

(get-node-id uuid)

Return the 48-bit node identifier.

Return the 48-bit node identifier.
sourceraw docstring

get-time-highclj

(get-time-high uuid)

Return the time_high field (12 bits) of UUID.

Return the time_high field (12 bits) of UUID.
sourceraw docstring

get-time-lowclj

(get-time-low uuid)

Return the time_low field (32 bits) of UUID.

Return the time_low field (32 bits) of UUID.
sourceraw docstring

get-time-midclj

(get-time-mid uuid)

Return the time_mid field (16 bits) of UUID.

Return the time_mid field (16 bits) of UUID.
sourceraw docstring

get-timestampclj

(get-timestamp uuid)

Return the timestamp associated with time-based UUIDs (v1, v6, v7). Returns nil for non-time-based UUIDs.

Return the timestamp associated with time-based UUIDs (v1, v6, v7).
Returns nil for non-time-based UUIDs.
sourceraw docstring

get-unix-timeclj

(get-unix-time uuid)

Return the unix time (milliseconds since epoch) for time-based UUIDs. Returns nil for non-time-based UUIDs.

Return the unix time (milliseconds since epoch) for time-based UUIDs.
Returns nil for non-time-based UUIDs.
sourceraw docstring

get-variantclj

(get-variant uuid)

Return the variant number associated with this UUID.

Return the variant number associated with this UUID.
sourceraw docstring

get-versionclj

(get-version uuid)

Return the version number associated with this UUID.

Return the version number associated with this UUID.
sourceraw docstring

get-word-highclj

(get-word-high uuid)

Return the high 64 bits (most significant word) of UUID.

Return the high 64 bits (most significant word) of UUID.
sourceraw docstring

get-word-lowclj

(get-word-low uuid)

Return the low 64 bits (least significant word) of UUID.

Return the low 64 bits (least significant word) of UUID.
sourceraw docstring

maxclj

(max)

Generates the v15 (maximum) UUID: ffffffff-ffff-ffff-ffff-ffffffffffff

Generates the v15 (maximum) UUID: ffffffff-ffff-ffff-ffff-ffffffffffff
sourceraw docstring

max?clj

(max? uuid)

Return true if UUID has all 128 bits set.

Return true if UUID has all 128 bits set.
sourceraw docstring

monotonic-timeclj

(monotonic-time)

Return a monotonic timestamp based on Gregorian calendar.

Return a monotonic timestamp based on Gregorian calendar.
sourceraw docstring

nullclj

(null)

Generates the v0 (null) UUID: 00000000-0000-0000-0000-000000000000

Generates the v0 (null) UUID: 00000000-0000-0000-0000-000000000000
sourceraw docstring

null?clj

(null? uuid)

Return true if UUID has all 128 bits set to zero.

Return true if UUID has all 128 bits set to zero.
sourceraw docstring

squuidclj

(squuid)

Generate a SQUUID (sequential, random) unique identifier. Non-standard variation on v4 that increases sequentially over time.

Generate a SQUUID (sequential, random) unique identifier.
Non-standard variation on v4 that increases sequentially over time.
sourceraw docstring

to-byte-arrayclj

(to-byte-array uuid)

Return an array of 16 bytes that represents the UUID.

Return an array of 16 bytes that represents the UUID.
sourceraw docstring

to-hex-stringclj

(to-hex-string uuid)

Return a 32-character hex string (no dashes).

Return a 32-character hex string (no dashes).
sourceraw docstring

to-stringclj

(to-string uuid)

Return a string representation of the UUID in canonical format.

Return a string representation of the UUID in canonical format.
sourceraw docstring

to-uriclj

(to-uri uuid)

Return the unique URN URI associated with this UUID.

Return the unique URN URI associated with this UUID.
sourceraw docstring

to-urn-stringclj

(to-urn-string uuid)

Return a URN string representation.

Return a URN string representation.
sourceraw docstring

uuid-string?clj

(uuid-string? s)

Return true if str is a valid UUID string.

Return true if str is a valid UUID string.
sourceraw docstring

uuid-urn-string?clj

(uuid-urn-string? s)

Return true if str is a valid UUID URN string.

Return true if str is a valid UUID URN string.
sourceraw docstring

uuid<clj

(uuid< x y)

Compare two UUIDs for < relation.

Compare two UUIDs for < relation.
sourceraw docstring

uuid=clj

(uuid= x y)

Compare two UUIDs for equality.

Compare two UUIDs for equality.
sourceraw docstring

uuid>clj

(uuid> x y)

Compare two UUIDs for > relation.

Compare two UUIDs for > relation.
sourceraw docstring

uuid?clj

(uuid? x)

Return true if x is a UUID.

Return true if x is a UUID.
sourceraw docstring

UUIDablecljprotocol

source

uuidable?clj

(uuidable? x)

Return true if 'x' can be coerced to UUID.

Return true if 'x' can be coerced to UUID.
sourceraw docstring

UUIDNameBytescljprotocol

source

UUIDRfc4122cljprotocol

source

UUIDRfc9562cljprotocol

source

v0clj

(v0)

Generates the v0 (null) UUID: 00000000-0000-0000-0000-000000000000

Generates the v0 (null) UUID: 00000000-0000-0000-0000-000000000000
sourceraw docstring

v1clj

(v1)

Generate a v1 (time-based) unique identifier, guaranteed to be unique and thread-safe regardless of clock precision or degree of concurrency.

Generate a v1 (time-based) unique identifier, guaranteed to be unique
and thread-safe regardless of clock precision or degree of concurrency.
sourceraw docstring

v3clj

(v3 context local-part)

Generate a v3 (name based, MD5 hash) UUID.

Args:

  • context: A UUIDable context (namespace)
  • local-part: The name to hash within the namespace
Generate a v3 (name based, MD5 hash) UUID.

Args:
- context: A UUIDable context (namespace)
- local-part: The name to hash within the namespace
sourceraw docstring

v4clj

(v4)
(v4 msb lsb)

Generate a v4 (random) UUID.

With no arguments, uses default JVM implementation. With two long arguments (msb, lsb), constructs a valid v4 UUID from those values.

Generate a v4 (random) UUID.

With no arguments, uses default JVM implementation.
With two long arguments (msb, lsb), constructs a valid v4 UUID from those values.
sourceraw docstring

v5clj

(v5 context local-part)

Generate a v5 (name based, SHA1 hash) UUID.

Args:

  • context: A UUIDable context (namespace)
  • local-part: The name to hash within the namespace
Generate a v5 (name based, SHA1 hash) UUID.

Args:
- context: A UUIDable context (namespace)
- local-part: The name to hash within the namespace
sourceraw docstring

v6clj

(v6)

Generate a v6 (time-based), lexically sortable, unique identifier. v6 is a field-compatible version of v1, reordered for improved DB locality.

Generate a v6 (time-based), lexically sortable, unique identifier.
v6 is a field-compatible version of v1, reordered for improved DB locality.
sourceraw docstring

v7clj

(v7)

Generate a v7 unix time-based, lexically sortable UUID with monotonic counter and cryptographically secure random portion.

Generate a v7 unix time-based, lexically sortable UUID with monotonic
counter and cryptographically secure random portion.
sourceraw docstring

v8clj

(v8 msb lsb)

Generate a v8 custom UUID with up to 122 bits of user data.

Args:

  • msb: Most significant 64 bits
  • lsb: Least significant 64 bits
Generate a v8 custom UUID with up to 122 bits of user data.

Args:
- msb: Most significant 64 bits
- lsb: Least significant 64 bits
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close