From a16b33031c7bcf2eabf1e0c3571000234b7740df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 24 Jan 2021 22:46:48 +0100 Subject: Attach service --- include/erebos/storage.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/erebos/storage.h') diff --git a/include/erebos/storage.h b/include/erebos/storage.h index 29eaa8f..4f67a4b 100644 --- a/include/erebos/storage.h +++ b/include/erebos/storage.h @@ -123,6 +123,9 @@ public: explicit operator std::string() const; bool isZero() const; + static Digest of(const std::vector & content); + template static Digest of(const ObjectT &); + const std::array & arr() const { return value; } bool operator==(const Digest & other) const { return value == other.value; } @@ -136,6 +139,12 @@ private: std::array value; }; +template +Digest Digest::of(const ObjectT & obj) +{ + return Digest::of(obj.encode()); +} + class PartialRef { public: -- cgit v1.2.3