-
Notifications
You must be signed in to change notification settings - Fork 0
/
uuid.clj
20 lines (17 loc) · 833 Bytes
/
uuid.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;; @ Copyright (c) Michael Leachim @
;; @ You can find additional information regarding licensing of this work in LICENSE.md @
;; @ You must not remove this notice, or any other, from this software. @
;; @ All rights reserved. @
;; @@@@@@ At 2018-16-10 21:39 <mklimoff222@gmail.com> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
(ns thereisnodot.utils.uuid)
(defn uuid
[]
(let [s4
#(as-> (Math/random) $
(+ 1 $)
(* 0x10000 $)
(Math/floor $)
(Integer/toHexString $)
(.substring $ 1))]
(str (s4) (s4) "-" (s4) "-" (s4) "-" (s4) "-" (s4) (s4) (s4))))