Skip to content

Instantly share code, notes, and snippets.

@gorsuch
Created December 1, 2011 18:37
Show Gist options
  • Save gorsuch/1418850 to your computer and use it in GitHub Desktop.
Save gorsuch/1418850 to your computer and use it in GitHub Desktop.
clojure uuid
(defn uuid [] (str (java.util.UUID/randomUUID)))
@niquola
Copy link

niquola commented Mar 10, 2015

👍 me too

@escherize
Copy link

Also, just noticed this library: http://danlentz.github.io/clj-uuid/ Hope it helps :)

@dillonforrest
Copy link

👍

Copy link

ghost commented Sep 30, 2015

good

@spiffytech
Copy link

👍

@blackawa
Copy link

👍

@kenfehling
Copy link

Is it weird/bad that I like this form instead?
(def uuid #(str (java.util.UUID/randomUUID)))

@camdez
Copy link

camdez commented Aug 28, 2017

@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.

@carbon-hvze
Copy link

thanks!

@aarkerio
Copy link

aarkerio commented Mar 4, 2020

¡Hartas gracias!

@siddharthjain-in
Copy link

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment