Skip to content

Instantly share code, notes, and snippets.

View huangzworks's full-sized avatar

黄健宏 huangzworks

View GitHub Profile
@hozumi
hozumi / sha1-hash.clj
Created December 13, 2011 16:46 — forked from prasincs/sha1-hash.clj
clojure sha1 hash
(defn sha1-str [s]
(->> (-> "sha1"
java.security.MessageDigest/getInstance
(.digest (.getBytes s)))
(map #(.substring
(Integer/toString
(+ (bit-and % 0xff) 0x100) 16) 1))
(apply str)))