summaryrefslogtreecommitdiff
path: root/crc32.c
diff options
context:
space:
mode:
Diffstat (limited to 'crc32.c')
-rw-r--r--crc32.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/crc32.c b/crc32.c
index 5d41211..4ee251a 100644
--- a/crc32.c
+++ b/crc32.c
@@ -61,14 +61,13 @@ static const uint32_t crc32_table[256] = {
0x2d02ef8d
};
-uint32_t crc32(uint32_t crc, unsigned char *buf, size_t len)
+uint32_t crc32(uint32_t crc, uint8_t *buf, size_t len)
{
- unsigned char *end;
+ uint8_t *end;
crc = ~crc;
- for (end = buf + len; buf < end; ++buf)
+ for (end = buf + len; buf < end; buf++)
crc = crc32_table[(crc ^ *buf) & BIT_MASK(8)] ^ (crc >> 8);
return ~crc;
}
-