Created
July 5, 2018 11:32
-
-
Save Heliosmaster/0b3057781ae7335994fa8e242ce50e94 to your computer and use it in GitHub Desktop.
Sha clojure
This file contains 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 sha [data-bytes] | |
(apply str (map #(.substring (Integer/toString (+ (bit-and % 0xff) 0x100) 16) 1) | |
(.digest (MessageDigest/getInstance "sha1") (.getBytes data-bytes))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment