* Adapted for LibUCW by Martin Mares <mj@ucw.cz> in 2012.
*/
+#ifndef _UCW_CRC_H
+#define _UCW_CRC_H
+
/**
* Internal CRC calculator context.
* You should use it just as an opaque handle only.
{
return ctx->state ^ 0xffffffff;
}
+
+/**
+ * A convenience one-shot function for CRC.
+ * It is equivalent to this snippet of code:
+ *
+ * crc32_context ctx;
+ * crc32_init(&ctx, CRC_MODE_DEFAULT);
+ * crc32_update(&ctx, buf, len);
+ * return crc32_final(&ctx);
+ */
+u32 crc32_hash_buffer(const byte *buf, uns len);
+
+#endif