Skip to content

Instantly share code, notes, and snippets.

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 Heliosmaster/0b3057781ae7335994fa8e242ce50e94 to your computer and use it in GitHub Desktop.
Save Heliosmaster/0b3057781ae7335994fa8e242ce50e94 to your computer and use it in GitHub Desktop.
Sha clojure
(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