Commits

Miki Tebeka  committed 520f97a

Initial version

  • Participants

Comments (0)

Files changed (4)

+syntax: glob
+
+lib
+classes
+========
+clj-uuid
+========
+
+A thin wrapper around java.util.UUID to provide uuid function
+
+Usage
+=====
+::
+    user=> (require 'uuid)
+    nil
+    user=> (uuid/uuid)
+    "e35f66e9-ec40-477b-9798-0b2df37cc80c"
+    user=> (uuid/name-uuid "foo")
+
+
+Installation
+============
+Add `[uuid "1.0.0"]` to your `project.clj` dependencies
+
+License
+=======
+
+Copyright (C) 2010 Miki Tebeka <miki.tebeka@gmail.com>
+Distributed under the Eclipse Public License, the same as Clojure.
+(defproject clj-uuid "1.0.0"
+  :description "Very thin wrapper for UUID"
+  :dependencies [[org.clojure/clojure "1.2.0"]])

File src/uuid.clj

+(ns uuid
+  (:import java.util.UUID))
+
+(defn uuid []
+  (str (UUID/randomUUID)))
+
+(defn name-uuid [s]
+  (str (UUID/nameUUIDFromBytes (.getBytes s))))
+