Last active
October 23, 2022 19:42
-
-
Save kubek2k/8446062 to your computer and use it in GitHub Desktop.
SHA-256 in 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 sha256 [string] | |
(let [digest (.digest (MessageDigest/getInstance "SHA-256") (.getBytes string "UTF-8"))] | |
(apply str (map (partial format "%02x") digest)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@l0st3d OK, now it's clear. Thanks for sharing this!