Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add file-md5 and cached-file-md5 helpers

  • Loading branch information...
commit 3d0f63a1251baff55cd715a8677c3a676bf4d151 1 parent 1fbac4c
@zk authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/clj/nsfw/util.clj
View
7 src/clj/nsfw/util.clj
@@ -240,3 +240,10 @@
(< d 2) "1 day"
(< y 1) (str (int d) " days")
:else (str (format "%.1f" y) " years")))))
+
+(defn file-md5 [src]
+ (-> src
+ slurp
+ md5))
+
+(def cached-file-md5 (memoize file-md5))
Please sign in to comment.
Something went wrong with that request. Please try again.