]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/crc.c
Fastbuf: fbmulti: static clist + FBMULTI() killing
[libucw.git] / ucw / crc.c
index 2c03ccdb39ac1236d4d7ba910e5dba3ff4e147f5..73fd2e69eb7a5b4aee371097c18ae8071792f488 100644 (file)
--- a/ucw/crc.c
+++ b/ucw/crc.c
@@ -134,6 +134,15 @@ crc32_init(crc32_context *ctx, uns crc_mode)
     }
 }
 
+u32
+crc32_hash_buffer(const byte *buf, uns len)
+{
+  crc32_context ctx;
+  crc32_init(&ctx, CRC_MODE_DEFAULT);
+  crc32_update(&ctx, buf, len);
+  return crc32_final(&ctx);
+}
+
 #ifdef TEST
 
 #include <stdio.h>