diff --git a/utils/crc.hh b/utils/crc.hh index 42f3a27c2c..167cad1a3c 100644 --- a/utils/crc.hh +++ b/utils/crc.hh @@ -34,6 +34,8 @@ #include #endif +#include "utils/fragment_range.hh" + namespace utils { class crc32 { @@ -162,6 +164,16 @@ public: _r = ::crc32(_r, in, size); } #endif + + template + GCC6_CONCEPT(requires FragmentRange) + void process_fragmented(const FragmentedBuffer& buffer) { + using boost::range::for_each; + for_each(buffer, [this] (bytes_view bv) { + process(reinterpret_cast(bv.data()), bv.size()); + }); + } + uint32_t get() const { return _r; }