X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fcrc.c;h=73fd2e69eb7a5b4aee371097c18ae8071792f488;hb=a77334e6d3812eb8fbf51563be35b97c1edfdab2;hp=2c03ccdb39ac1236d4d7ba910e5dba3ff4e147f5;hpb=497d58b96ab7e962dd53527ae0ed07c52680fea4;p=libucw.git diff --git a/ucw/crc.c b/ucw/crc.c index 2c03ccdb..73fd2e69 100644 --- 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