diff options
| author | eltrac <hi@eltr.ac> | 2026-03-23 23:02:40 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-23 23:02:40 +0800 |
| commit | 418bfa60b310a4a253db5c6b14519a67bbb27627 (patch) | |
| tree | aadc2344127e0a4e34fb4aa9f8b6cb50df3b4396 | |
| parent | 538c362a2cc8d01a418ec9aa7f7efd1d37d2977a (diff) | |
refactor(deps): replace digest with cljc-md5
| -rw-r--r-- | project.clj | 4 | ||||
| -rw-r--r-- | src/weepinbell/feed.clj | 4 | ||||
| -rw-r--r-- | src/weepinbell/receiver.clj | 4 | ||||
| -rw-r--r-- | src/weepinbell/wrapper.clj | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/project.clj b/project.clj index 22fb260..a14a2f6 100644 --- a/project.clj +++ b/project.clj @@ -13,10 +13,10 @@ [clj-http "3.13.1"] [com.kylewm/mf2j "0.0.4"] [com.taoensso/timbre "6.8.0"] - [digest "1.4.10"] [hiccup "2.0.0"] [clj-rss "0.4.0"] - [com.fzakaria/slf4j-timbre "0.4.1"]] + [com.fzakaria/slf4j-timbre "0.4.1"] + [thedavidmeister/cljc-md5 "0.0.2"]] :plugins [[lein-ancient "0.6.15"]] :ring {:handler weepinbell.handler/app} :main ^:skip-aot weepinbell.core diff --git a/src/weepinbell/feed.clj b/src/weepinbell/feed.clj index 638699d..f496152 100644 --- a/src/weepinbell/feed.clj +++ b/src/weepinbell/feed.clj @@ -3,7 +3,7 @@ [weepinbell.utils :refer [get-domain]] [weepinbell.config :refer [get-config]] [weepinbell.storage :as storage] - [digest :as digest]) + [md5.core :refer [string->md5-hex]]) (:import [java.time Instant])) (def feed-length (get-config :feed-length)) @@ -19,7 +19,7 @@ (->> wms (map #(let [wm (:webmention %) id (if-let [id (:id wm)] id - (digest/md5 (str (:source wm) (:target wm)))) + (string->md5-hex (str (:source wm) (:target wm)))) permalink (str (get-config :base-url) "/api/mention/" id) modified (:modified wm) pub-date (when modified diff --git a/src/weepinbell/receiver.clj b/src/weepinbell/receiver.clj index 662f53a..dbe3e2e 100644 --- a/src/weepinbell/receiver.clj +++ b/src/weepinbell/receiver.clj @@ -4,7 +4,7 @@ [clojure.core.async :refer [put!]] [weepinbell.utils :refer [validate-urls validate-target respond-json]] [weepinbell.config :refer [get-config]] - [digest :as digest] + [md5.core :refer [string->md5-hex]] [cheshire.core :as json])) (defn verify-request @@ -44,7 +44,7 @@ (put! wmc wm) ;; respond with 201 when Webmention passed checks and ;; was sent into queue, include a Location header - (let [wm-id (digest/md5 (str source target)) + (let [wm-id (string->md5-hex (str source target)) wm-url (str (get-config :base-url) "/api/mention/" wm-id) response {:status 201 :message "Webmention is accepted and pending for verification." diff --git a/src/weepinbell/wrapper.clj b/src/weepinbell/wrapper.clj index f1493c4..8c3246a 100644 --- a/src/weepinbell/wrapper.clj +++ b/src/weepinbell/wrapper.clj @@ -4,8 +4,8 @@ download-file]] [weepinbell.config :refer [get-config]] [weepinbell.microformats :as microformats] - [digest :as digest] - [taoensso.timbre :as timbre])) + [taoensso.timbre :as timbre] + [md5.core :refer [string->md5-hex]])) (defn- find-mf-photo [mf] (or (-> mf @@ -19,7 +19,7 @@ (if raw-photo (let [photo-url (str raw-photo) file-ext (or (re-find #"\.(?:jpg|jpeg|png|gif|webp)" photo-url) ".jpg") - filename (str (digest/md5 photo-url) file-ext) + filename (str (string->md5-hex photo-url) file-ext) local-path (str "data/avatars/" filename) public-path (str "/avatars/" filename)] ;; download photo if not exists @@ -38,7 +38,7 @@ javamap->map) wm {:source source :target target - :id (digest/md5 (str source target)) + :id (string->md5-hex (str source target)) :modified (System/currentTimeMillis)} proxied-photo (-> mf find-mf-photo proxy-mf-photo)] {:webmention wm |
