We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25e4945 commit 635afaeCopy full SHA for 635afae
src/main/cljs/cljs/core.cljs
@@ -9534,6 +9534,19 @@ Maps become Objects. Arbitrary keys are encoded to by key->js."
9534
(defn uuid [s]
9535
(UUID. s nil))
9536
9537
+(defn random-uuid []
9538
+ (letfn [(hex [] (.toString (rand-int 15) 16))]
9539
+ (let [rhex (.toString (bit-or 0x8 (bit-and 0x3 (rand-int 14))) 16)]
9540
+ (uuid
9541
+ (str (hex) (hex) (hex) (hex)
9542
+ (hex) (hex) (hex) (hex) "-"
9543
9544
+ "4" (hex) (hex) (hex) "-"
9545
+ rhex (hex) (hex) (hex) "-"
9546
+ (hex) (hex) (hex) (hex)
9547
9548
+ (hex) (hex) (hex) (hex))))))
9549
+
9550
;;; ExceptionInfo
9551
9552
(defn- pr-writer-ex-info [obj writer opts]
0 commit comments