From b4acf9ccb0fcd20da4b9205f8d66b2169cd7edd9 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 3 Dec 2024 04:03:33 +0100
Subject: [PATCH] To fix sync, add comparison and string representation to Hash
 class.

---
 src/ytplom/db.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/ytplom/db.py b/src/ytplom/db.py
index 5387eca..30d84fc 100644
--- a/src/ytplom/db.py
+++ b/src/ytplom/db.py
@@ -31,6 +31,14 @@ class Hash:
     def __init__(self, as_bytes: bytes) -> None:
         self.bytes = as_bytes
 
+    def __eq__(self, other):
+        if not isinstance(other, Hash):
+            return False
+        return self.bytes == other.bytes
+
+    def __str__(self):
+        return self.b64
+
     @classmethod
     def from_file(cls, path: Path) -> Self:
         """Hash-digest file at path, instantiate with hash's bytes."""
-- 
2.30.2