diff --git a/README.md b/README.md index 5af48d4..b83ef24 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ clj-uuid [![Build Status](https://travis-ci.org/danlentz/clj-uuid.svg?branch=master)] (https://travis-ci.org/danlentz/clj-uuid) -[![Dependency Status](https://www.versioneye.com/clojure/danlentz:clj-uuid/0.1.2-SNAPSHOT/badge.svg)](https://www.versioneye.com/clojure/danlentz:clj-uuid/0.1.2-SNAPSHOT) +[![Dependency Status](https://www.versioneye.com/clojure/danlentz:clj-uuid/0.1.3-SNAPSHOT/badge.svg)](https://www.versioneye.com/clojure/danlentz:clj-uuid/0.1.3-SNAPSHOT) **clj-uuid** is a Clojure library for generation and utilization of @@ -416,8 +416,8 @@ used in the graph-object database system ### A Simple Example -Ok, so now you know how to use this nifty new UUID library and your are -burning up to do somthing awesome with UUID's... But, ah, hmmm... First +Ok, so now you know how to use this nifty new UUID library and you are +burning up to do something awesome with UUID's... But, ah, hmmm... First you need to figure out what exactly you want to do with them. Well, before you start working on your distributed cloud-based secret weapon, here is a simple way you can generate cryptographically diff --git a/src/clj_uuid.clj b/src/clj_uuid.clj index 163a496..378336d 100644 --- a/src/clj_uuid.clj +++ b/src/clj_uuid.clj @@ -7,9 +7,11 @@ [clock :as clock] [node :as node]]) (:import [java.security MessageDigest] - [java.io ByteArrayOutputStream ObjectOutputStream] - [java.net URI URL] - [java.util UUID])) + [java.io ByteArrayOutputStream + ObjectOutputStream] + [java.net URI + URL] + [java.util UUID])) (set! *warn-on-reflection* true) diff --git a/src/clj_uuid/node.clj b/src/clj_uuid/node.clj index 3e91dd4..72ba919 100644 --- a/src/clj_uuid/node.clj +++ b/src/clj_uuid/node.clj @@ -88,6 +88,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(def ^:private datasources ["java.vendor" + "java.vendor.url" + "java.version" + "os.arch" + "os.name" + "os.version"]) (defn- all-local-addresses [] (let [^InetAddress local-host (InetAddress/getLocalHost) @@ -110,9 +116,7 @@ ^Properties props (System/getProperties) to-digest (reduce (fn [acc key] (conj acc (.getProperty props key))) - addresses ["java.vendor" "java.vendor.url" - "java.version" "os.arch" - "os.name" "os.version"])] + addresses datasources)] (doseq [^String d to-digest] (compile-if (java6?) (.update digest (.getBytes d))