Skip to content

Instantly share code, notes, and snippets.

@rotaliator
Created March 25, 2022 10:17
Show Gist options
  • Save rotaliator/0f240bf0e6598b9753e2d68a989e9ccc to your computer and use it in GitHub Desktop.
Save rotaliator/0f240bf0e6598b9753e2d68a989e9ccc to your computer and use it in GitHub Desktop.
md5 clojure
;; 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