diff --git a/Numeric/CRC.hpp b/Numeric/CRC.hpp index 47ca62547..66578b404 100644 --- a/Numeric/CRC.hpp +++ b/Numeric/CRC.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace CRC { @@ -67,22 +68,13 @@ public: void set_value(const IntT value) { value_ = value; } /*! - Calculates the CRC of the provided collection, assuming that it contains `uint8_t`s. + Calculates the CRC of the provided range, assuming that it contains `uint8_t`s. */ - template - static IntT crc_of(const Collection &data) { - return crc_of(data.begin(), data.end()); - } - - /*! - Calculates the CRC of all `uint8_t`s in the range defined by @c begin and @c end. - */ - template - static IntT crc_of(Iterator begin, const Iterator end) { + template + static IntT crc_of(const R &data) { Generator generator; - while(begin != end) { - generator.add(*begin); - ++begin; + for(const auto &byte : data) { + generator.add(byte); } return generator.get_value(); }