-
-
Save defclass/f6aed905fe823f8ee167c7e628ec87ca to your computer and use it in GitHub Desktop.
clojure sha1 hash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn sha1-str [s] | |
(->> (-> "sha1" | |
java.security.MessageDigest/getInstance | |
(.digest (.getBytes s))) | |
(map #(.substring | |
(Integer/toString | |
(+ (bit-and % 0xff) 0x100) 16) 1)) | |
(apply str))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment