Skip to content

Instantly share code, notes, and snippets.

@tomjack
Created March 23, 2011 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomjack/44ebe95923fa6a4bc5c7 to your computer and use it in GitHub Desktop.
Save tomjack/44ebe95923fa6a4bc5c7 to your computer and use it in GitHub Desktop.
(let [md5 (MessageDigest/getInstance "MD5")]
(defn md5-seed [s]
(let [digest (.digest md5 (.getBytes s))]
(with-open [bytes-in (ByteArrayInputStream. digest)
data-in (DataInputStream. bytes-in)]
(.readLong data-in)))))
(->> (.readLong data-in)
(with-open [bytes-in (ByteArrayInputStream. digest)
data-in (DataInputStream. bytes-in)])
(let [digest (.digest md5 (.getBytes s))])
(defn md5-seed [s])
(let [md5 (MessageDigest/getInstance "MD5")]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment