Skip to content
Browse files

Add file-md5 and cached-file-md5 helpers

  • Loading branch information...
1 parent 1fbac4c commit 3d0f63a1251baff55cd715a8677c3a676bf4d151 @zk committed Nov 13, 2013
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))

0 comments on commit 3d0f63a

Please sign in to comment.
Something went wrong with that request. Please try again.