Liking cljdoc? Tell your friends :D

cljs-uuid-utils.core

ClojureScript micro-library with an implementation of a type 4, random UUID generator compatible with RFC-4122 and cljs.core/UUID (make-random-uuid), a getter function to obtain the uuid string representation from a UUID-instance (uuid-string), a uuid-string conformance validating predicate (valid-uuid?), and a UUID factory from uuid-string with conformance validation (make-uuid-from).

ClojureScript micro-library with an implementation of a type 4, random UUID generator compatible with RFC-4122 and cljs.core/UUID (make-random-uuid), a getter function to obtain the uuid string representation from a UUID-instance (uuid-string), a uuid-string conformance validating predicate (valid-uuid?), and a UUID factory from uuid-string with conformance validation (make-uuid-from).
raw docstring

make-random-squuidcljs

(make-random-squuid)

(make-random-squuid) => new-uuid Arguments and Values: new-squuid --- new type 4 (pseudo randomly generated) cljs.core/UUID instance. Description: Returns pseudo randomly generated, semi-sequential SQUUID. See http://docs.datomic.com/clojure/#datomic.api/squuid Returns a UUID where the most significant 32 bits are the current time since epoch in seconds. like: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx as per http://www.ietf.org/rfc/rfc4122.txt. Examples: (make-random-squuid) => #uuid "305e764d-b451-47ae-a90d-5db782ac1f2e" (type (make-random-squuid)) => cljs.core/UUID

(make-random-squuid)  =>  new-uuid
Arguments and Values:
new-squuid --- new type 4 (pseudo randomly generated) cljs.core/UUID instance.
Description:
Returns pseudo randomly generated, semi-sequential SQUUID. 
See http://docs.datomic.com/clojure/#datomic.api/squuid
Returns a UUID where the most significant 32 bits are the current time since epoch in seconds.
like: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx as per http://www.ietf.org/rfc/rfc4122.txt.
Examples:
(make-random-squuid)  =>  #uuid "305e764d-b451-47ae-a90d-5db782ac1f2e"
(type (make-random-squuid)) => cljs.core/UUID
sourceraw docstring

make-random-uuidcljs

(make-random-uuid)

(make-random-uuid) => new-uuid Arguments and Values: new-uuid --- new type 4 (pseudo randomly generated) cljs.core/UUID instance. Description: Returns pseudo randomly generated UUID, like: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx as per http://www.ietf.org/rfc/rfc4122.txt. Examples: (make-random-uuid) => #uuid "305e764d-b451-47ae-a90d-5db782ac1f2e" (type (make-random-uuid)) => cljs.core/UUID

(make-random-uuid)  =>  new-uuid
Arguments and Values:
new-uuid --- new type 4 (pseudo randomly generated) cljs.core/UUID instance.
Description:
Returns pseudo randomly generated UUID,
like: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx as per http://www.ietf.org/rfc/rfc4122.txt.
Examples:
(make-random-uuid)  =>  #uuid "305e764d-b451-47ae-a90d-5db782ac1f2e"
(type (make-random-uuid)) => cljs.core/UUID
sourceraw docstring

make-uuid-fromcljs

(make-uuid-from maybe-uuid)

(make-uuid-from maybe-uuid maybe-uuid) => uuid-or-nil Arguments and Values: maybe-uuid --- string or UUID-instance that may represent a conformant UUID. uuid-or-nil --- Returns either a cljs.core/UUID instance or nil. Description: Returns a cljs.core/UUID instance for a conformant UUID-string representation, or nil. Input can be a string or a cljs.core/UUID instance. Note that if the input UUID-instance is not valid, nil is returned. Examples: (make-uuid-from "NO-WAY") => nil (make-uuid-from "4d7332e7-e4c6-4ca5-af91-86336c825e25") => #uuid "4d7332e7-e4c6-4ca5-af91-86336c825e25" (make-uuid-from (UUID. "4d7332e7-e4c6-4ca5-af91-86336c825e25")) => #uuid "4d7332e7-e4c6-4ca5-af91-86336c825e25" (make-uuid-from (UUID. "YES-WAY")) => nil

(make-uuid-from maybe-uuid maybe-uuid)  =>  uuid-or-nil
Arguments and Values:
maybe-uuid --- string or UUID-instance that may represent a conformant UUID.
uuid-or-nil --- Returns either a cljs.core/UUID instance or nil.
Description:
Returns a cljs.core/UUID instance for a conformant UUID-string representation, or nil.
Input can be a string or a cljs.core/UUID instance.
Note that if the input UUID-instance is not valid, nil is returned.
Examples:
(make-uuid-from "NO-WAY")  =>  nil
(make-uuid-from "4d7332e7-e4c6-4ca5-af91-86336c825e25")  => #uuid "4d7332e7-e4c6-4ca5-af91-86336c825e25"
(make-uuid-from (UUID. "4d7332e7-e4c6-4ca5-af91-86336c825e25"))  => #uuid "4d7332e7-e4c6-4ca5-af91-86336c825e25"
(make-uuid-from (UUID. "YES-WAY"))  => nil
sourceraw docstring

uuid-stringcljs

(uuid-string a-uuid)

(uuid-string a-uuid) => uuid-str Arguments and Values: a-uuid --- a cljs.core/UUID instance. uuid-str --- returns a string representation of the UUID instance Description: Returns the string representation of the UUID instance in the format of, "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" similarly to java.util.UUID/toString. Note that this is different from cljs.core/UUID's EDN string-format. Examples: (def u (make-random-uuid)) => #uuid "305e764d-b451-47ae-a90d-5db782ac1f2e" (uuid-string u) => "305e764d-b451-47ae-a90d-5db782ac1f2e"

(uuid-string a-uuid)  =>  uuid-str
Arguments and Values:
a-uuid --- a cljs.core/UUID instance.
uuid-str --- returns a string representation of the UUID instance
Description:
Returns the string representation of the UUID instance in the format of,
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" similarly to java.util.UUID/toString.
Note that this is different from cljs.core/UUID's EDN string-format.
Examples:
(def u (make-random-uuid))  =>  #uuid "305e764d-b451-47ae-a90d-5db782ac1f2e"
(uuid-string u) => "305e764d-b451-47ae-a90d-5db782ac1f2e"
sourceraw docstring

valid-uuid?cljs

(valid-uuid? maybe-uuid)

(valid-uuid? maybe-uuid) => truthy-falsy Arguments and Values: maybe-uuid --- string or UUID-instance that may represent a conformant UUID. truthy-falsy --- Returns either the conforming UUID-string (truthy) or nil (falsy). Description: Predicate to test whether a string representation conforms to a "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" format where each x is a hexadecimal character. Input can be a maybe-uuid string or a cljs.core/UUID instance. Note that the current "cljs.core/UUID." constructor does not check for any conformance. Examples: (valid-uuid? "NO-WAY") => nil (valid-uuid? "4d7332e7-e4c6-4ca5-af91-86336c825e25") => "4d7332e7-e4c6-4ca5-af91-86336c825e25" (valid-uuid? (UUID. "4d7332e7-e4c6-4ca5-af91-86336c825e25")) => "4d7332e7-e4c6-4ca5-af91-86336c825e25" (valid-uuid? (UUID. "YES-WAY")) => nil

(valid-uuid? maybe-uuid)  =>  truthy-falsy
Arguments and Values:
maybe-uuid --- string or UUID-instance that may represent a conformant UUID.
truthy-falsy --- Returns either the conforming UUID-string (truthy) or nil (falsy).
Description:
Predicate to test whether a string representation conforms to a
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" format where each x is a hexadecimal character.
Input can be a maybe-uuid string or a cljs.core/UUID instance.
Note that the current "cljs.core/UUID." constructor does not check for any conformance.
Examples:
(valid-uuid? "NO-WAY")  =>  nil
(valid-uuid? "4d7332e7-e4c6-4ca5-af91-86336c825e25")  => "4d7332e7-e4c6-4ca5-af91-86336c825e25"
(valid-uuid? (UUID. "4d7332e7-e4c6-4ca5-af91-86336c825e25"))  => "4d7332e7-e4c6-4ca5-af91-86336c825e25"
(valid-uuid? (UUID. "YES-WAY"))  => nil
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close