-
-
Save gorsuch/1418850 to your computer and use it in GitHub Desktop.
(defn uuid [] (str (java.util.UUID/randomUUID))) |
👍
cool!
There should be a pure Clojure library for UUIDs to be compatible across different implementations.
FYI: "There are four different basic types of UUIDs: time-based, DCE security, name-based, and randomly generated UUIDs. These types have a version value of 1, 2, 3 and 4, respectively." http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html#randomUUID()
Thank you :-).
Thank you
Maybe I should memorize this, but I always just google 'clojure uuid' instead. Thanks. 👍
👍 me too
Also, just noticed this library: http://danlentz.github.io/clj-uuid/ Hope it helps :)
👍
good
👍
👍
Is it weird/bad that I like this form instead?
(def uuid #(str (java.util.UUID/randomUUID)))
@kenfehling It's not particularly weird or bad, but one small downside is that the function will lack the :arglists
metadata the way you've written it (try running (:arglists (meta #'uuid))
), which some development tooling might rely on to show you how to call the function.
thanks!
¡Hartas gracias!
thanks!
Thank you