From d16d30c483f282a16ff49230866890f13a6537e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Thu, 20 Apr 2023 22:40:48 -0400 Subject: [PATCH] Hash: add Hash<N>::get(Hash<M>) to compute an hash from another --- include/opendht/infohash.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/opendht/infohash.h b/include/opendht/infohash.h index ee26fd2f..25753614 100644 --- a/include/opendht/infohash.h +++ b/include/opendht/infohash.h @@ -229,6 +229,11 @@ public: return get(data.data(), data.size()); } + template <size_t H> + static Hash get(const Hash<H>& o) { + return get(o.data(), o.size()); + } + /** * Computes the hash from a given data buffer of size data_len. */ -- GitLab