Created
March 25, 2022 10:17
-
-
Save rotaliator/0f240bf0e6598b9753e2d68a989e9ccc to your computer and use it in GitHub Desktop.
md5 clojure
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
;; https://gist.github.com/jizhang/4325757?permalink_comment_id=2633984#gistcomment-2633984 | |
(ns md5-clj | |
(:import (java.security MessageDigest) | |
(java.math BigInteger))) | |
(defn md5 | |
[^String s] | |
(->> s | |
.getBytes | |
(.digest (MessageDigest/getInstance "MD5")) | |
(BigInteger. 1) | |
(format "%032x"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment