summaryrefslogtreecommitdiff
path: root/zen/crc.h
diff options
context:
space:
mode:
Diffstat (limited to 'zen/crc.h')
-rw-r--r--zen/crc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/zen/crc.h b/zen/crc.h
index b617bdd0..5c950efc 100644
--- a/zen/crc.h
+++ b/zen/crc.h
@@ -19,6 +19,19 @@
namespace zen
{
+uint16_t getCrc16(const std::string& str);
+uint32_t getCrc32(const std::string& str);
+template <class ByteIterator> uint16_t getCrc16(ByteIterator first, ByteIterator last);
+template <class ByteIterator> uint32_t getCrc32(ByteIterator first, ByteIterator last);
+
+
+
+
+//------------------------- implementation -------------------------------
+inline uint16_t getCrc16(const std::string& str) { return getCrc16(str.begin(), str.end()); }
+inline uint32_t getCrc32(const std::string& str) { return getCrc32(str.begin(), str.end()); }
+
+
template <class ByteIterator> inline
uint16_t getCrc16(ByteIterator first, ByteIterator last)
{
bgstack15