mirror of
https://github.com/logseq/logseq.git
synced 2026-05-01 01:16:27 +00:00
Merge branch 'master' into refactor/page-parent
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
[logseq.common.config :as common-config]
|
||||
[logseq.common.path :as path]
|
||||
[logseq.common.util :as common-util]
|
||||
[logseq.db.frontend.asset :as db-asset]
|
||||
[medley.core :as medley]
|
||||
[missionary.core :as m]
|
||||
[promesa.core :as p])
|
||||
@@ -177,18 +178,10 @@
|
||||
blob (js/Blob. (array binary) (clj->js {:type "image"}))]
|
||||
(when blob (js/URL.createObjectURL blob)))))))
|
||||
|
||||
(defn- decode-digest
|
||||
[^js/Uint8Array digest]
|
||||
(.. (js/Array.from digest)
|
||||
(map (fn [s] (.. s (toString 16) (padStart 2 "0"))))
|
||||
(join "")))
|
||||
|
||||
(defn get-file-checksum
|
||||
[^js/Blob file]
|
||||
(-> (.arrayBuffer file)
|
||||
(.then (fn [buf] (js/crypto.subtle.digest "SHA-256" buf)))
|
||||
(.then (fn [dig] (js/Uint8Array. dig)))
|
||||
(.then decode-digest)))
|
||||
(.then db-asset/<get-file-array-buffer-checksum)))
|
||||
|
||||
(defn <get-all-assets
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user