summaryrefslogtreecommitdiffhomepage
path: root/services/blog/nuldoc-src/components/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'services/blog/nuldoc-src/components/utils.ts')
-rw-r--r--services/blog/nuldoc-src/components/utils.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/blog/nuldoc-src/components/utils.ts b/services/blog/nuldoc-src/components/utils.ts
new file mode 100644
index 00000000..14059b5b
--- /dev/null
+++ b/services/blog/nuldoc-src/components/utils.ts
@@ -0,0 +1,8 @@
+import { Hash } from "checksum/mod.ts";
+
+export async function calculateFileHash(
+ filePath: string,
+): Promise<string> {
+ const content = await Deno.readFile(filePath);
+ return new Hash("md5").digest(content).hex();
+}