aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/hash.hh
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-05-01 20:10:00 +0200
committereldritch horrors <pennae@lix.systems>2024-07-06 12:36:37 +0200
commit5af76dee371ea5fa1eb72141370fdf18851d67c7 (patch)
treea51cc0348910a8fce0df02c132efe9a438ddd911 /src/libutil/hash.hh
parent4162a66cee97ec16c88d991ef9a6d9baa3740053 (diff)
libutil: turn HashModuloSink into a free function
Change-Id: I5878007502fa68c2816a0f4c61f7d0e60bdde702
Diffstat (limited to 'src/libutil/hash.hh')
-rw-r--r--src/libutil/hash.hh7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh
index bb2a5e2a7..1c2f8493b 100644
--- a/src/libutil/hash.hh
+++ b/src/libutil/hash.hh
@@ -203,5 +203,12 @@ public:
HashResult currentHash();
};
+inline HashResult hashSource(HashType ht, Source & source)
+{
+ HashSink h(ht);
+ source.drainInto(h);
+ return h.finish();
+}
+
}