buch_des_monats/src/buchdesmonats/hash.clj
Aaron Fischer 08f504f303 Generalize codebase and add more datasources.
Fixes #9
Relates #8

* Support mojoreads as a new data source
* Change image file names to hashsums to be more generic
* Clean up the source code by separate relates stuff in own files
* Fix the Chaos Monkeys book
2020-11-10 20:43:04 +01:00

12 lines
326 B
Clojure

(ns buchdesmonats.hash
(:import [java.security MessageDigest]
[java.math BigInteger]))
;;; Stolen from: https://gist.github.com/jizhang/4325757#gistcomment-2633984
(defn md5 [^String s]
(->> s
.getBytes
(.digest (MessageDigest/getInstance "MD5"))
(BigInteger. 1)
(format "%032x")))