aboutsummaryrefslogtreecommitdiff
path: root/internal/gallery/id.go
diff options
context:
space:
mode:
authorRanXom <saiyedshizain@gmail.com>2026-07-13 12:24:29 +0530
committerRanXom <saiyedshizain@gmail.com>2026-07-13 12:24:29 +0530
commit1694a7b3d4db4dc5f089ca272a3f207c7c458a63 (patch)
tree2e7ddee1431637873a507800f15881efd2bc262b /internal/gallery/id.go
parent0d44904c3e54bb3fe393e88c12a152a799b9773b (diff)
downloadgalleryd-1694a7b3d4db4dc5f089ca272a3f207c7c458a63.tar.xz
galleryd-1694a7b3d4db4dc5f089ca272a3f207c7c458a63.zip
feat(gallery): generate stable photo identifiers
Diffstat (limited to 'internal/gallery/id.go')
-rw-r--r--internal/gallery/id.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/gallery/id.go b/internal/gallery/id.go
new file mode 100644
index 0000000..b23ebf5
--- /dev/null
+++ b/internal/gallery/id.go
@@ -0,0 +1,11 @@
+package gallery
+
+import (
+ "crypto/sha256"
+ "encoding/hex"
+)
+
+func generateID(relativePath string) string {
+ sum := sha256.Sum256([]byte(relativePath))
+ return hex.EncodeToString(sum[:])
+}