Skip to content

Instantly share code, notes, and snippets.

@mangosmoothie
Created July 17, 2019 22:51
Show Gist options
  • Save mangosmoothie/577406119cf24c51e8615bf8a975580c to your computer and use it in GitHub Desktop.
Save mangosmoothie/577406119cf24c51e8615bf8a975580c to your computer and use it in GitHub Desktop.
sha-1 hash clojure
(:import java.nio.charset.Charset
java.security.MessageDigest
javax.xml.bind.DatatypeConverter)
(defn get-sha [s]
(DatatypeConverter/printHexBinary
(.digest (MessageDigest/getInstance "SHA-1") (.getBytes s "UTF-8"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment